Suppose if a object has parameters var data={"f name":"vishal"}
and i want to access parameter "f name" in javascript. I know that there should not be space in parameters of a object but if it has space in it then how can i read it.
Asked
Active
Viewed 2,290 times
1
-
2Bracket notation: `data["f name"]` – Michael Berkowski Feb 15 '13 at 13:34
-
You can answer here: https://stackoverflow.com/questions/4968406/javascript-property-access-dot-notation-vs-brackets – Ilyas karim Apr 12 '18 at 10:18
3 Answers
1
Spaces in attribute names are perfectly OK in JavaScript. You reference them by the
object["param name"]
syntax. Moreover, any UTF8 character, except for control characters, are valid in attribute names.

marekful
- 14,986
- 6
- 37
- 59