javascript code shows error in Internet Explorer but not in FF.
$(document).ready(function(){
var countries = [
["Afghanistan","Af"],
["Åland Islands","Ax"],
["Zimbabwe","Zw"]
];
var countryNames = countries.map(function(country){
return {
/*label: '<div class="flag '+country[1].toLowerCase()+'">'+country[0]+'</div>',*/
value: country[0]
}
var my_var=countryNames();
});
});
In IE 8 developer tool, if I debug js, the error message is :' Object doesn't support this property or method'. And the error is indicated at the snippet starting with the line :
var countryNames = countries.map(function(country){
How to make the code work in IE ?
map()function, it's only supported in IE9.