javascript - Accessing JS object value with variable -


so lets take code:

    $('.show-popup').on('click', function(){         var id = $(this).data('id');         console.log(id);         console.log(overlay_data[id]);     }); 

i output:

28125  undefined 

if hard code value in, outputs every time. not work, if pass key via variable. how make work?


Comments

Popular posts from this blog

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

python - GRASS parser() error -

Swift game error message -