When i type this code in javascript console, this does not through an error, instead it runs.
var a = {
b:"123",
update(){
console.log("hello");
}
}
The problem is, update()
does not have a function keyword and when i check the properties of object a
, i get :
b: "123"
update: function ()
__proto__: Object
What is javascript actually doing here?