I have numbers of a dynamically generated array in my script such as below:
var abc = {
'Lorem' = 'Ipsum is simply dummy text of the printing and typesetting industry.',
'Why' = 'but also the leap into electronic typesetting',
'Where' = 'making it over 2000 years old.'
}
var def = {
'Lore' = 'Ipsum is simply dummy text of the printing and typesetting industry.',
'hy' = 'but also the leap into electronic typesetting',
'Whre' = 'making it over 2000 years old.'
}
var ghi = {
'Lrem' = 'Ipsum is simply dummy text of the printing and typesetting industry.',
'Wh' = 'but also the leap into electronic typesetting',
'Were' = 'making it over 2000 years old.'
}
Now I need to get value from an array, I got the name of the array dynamically from a user and I store it in a variable like array_name.
I was trying to get value from variable like
var array_name = `abc`;
console.log(array_name['lorem']);
it gives me undefined as a response. Also, try to store value in hidden field and get value from textbox, but it hadn't work for me:
console.log(($('#array_name').val()['lorem']);
Please help me get value from array.