javascript - Why is it returning undefined? -
i want store following method, , constant value, querying using key find value or value find key
function my_reference() { return { 30:'', 31:'err591', 32:'err761', 33:'err671', 34:'err551', }; } console.log( my_reference[31], my_reference.31, my_reference().31, my_reference()[31] );
my_reference[31],
trying read property (which doesn't exist) of function. property on object return value of calling function.
my_reference.31,
trying use number identifier. isn't allowed.
my_reference().31,
trying use number identifier. isn't allowed.
my_reference()[31]
this works
Comments
Post a Comment