I have a map in apex class as a getter setter and currently accessing in the javascript of the visualforce page. But when i try to traverse a map, it is not displaying the values correctly, instead of each word, it is displaying the letters. Any help? Code :
function test() {
//This is how the map stored in apex controller
var buttonMap = {apple=1,banana=2,Grapes=4};
for(var key in buttonMap) {
console.log(buttonMap[key]); //Which displays values as a p p l e b = 1 b a
}
}