Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
var data={"f name":"vishal"}
data["f name"]
Something like this:
data['f name']
Add a comment
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.
Use square bracket notation:
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
data["f name"]