Associative array Ionic2


#1

Hi all ! Is it possible generate associative array with key=>value ?


#2

Hi!

Yes try this

var arr = new Array();
arr['key1'] = 'value1';
arr['key2'] = 'value2';

console.log(arr['key1']) // Output => value1

#3

Umm, no. Arrays and objects are different things.