[Solved] What’s this JavaScript syntax with the “$” and “[]”?


what does the [] mean?

[] is a special javascript property access notation . imagine if i have an ojbect like:

var o =  {
   "abc.xyz" : 5
};

I can’t say o.abc.xyz , that’s where [] is handy o['abc.xyz'].

What’s special with the $?

$ is often used as a naming convention with jquery for examle:

var $this = $(this);

5

solved What’s this JavaScript syntax with the “$” and “[]”?