javascript - JS removing object method from this method -


i have sample code: https://jsfiddle.net/gdm3rk8r/2/

var map = { }; map[5] = function() {    alert('hey!');    delete map[5]; }  map[5](); 

it's working, correct practise?

edit1: more concrete, have exchange or delete callback same callback


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -