javascript - issue with adding a method in object -


i have object:

var point = {     step: function () {         alert("hello");     } }; 

this works:point.step();.

how make work [ ] notation? meaning point["property_name"].

it point["step"]();. here snippet:

var point = {      step: function () {          alert("hello");      }  };    point["step"]();


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -