Reputation: 18589
How would I write this in dot notation?
req.headers['x-forwarded-for']
This does not work
req.headers.xForwardedFor
Upvotes: 0
Views: 430
Reputation: 664425
You cannot, since for dot notation the property name would need to be a valid identifier name which must not contain dashes.
Upvotes: 3
Reputation: 64657
You wouldn't, you can't access an object property with dashes in it using dot notation.
Upvotes: 2