i've created this prototype method for Object, but it stops all my code, when i test it, it works for some objects list but followings codes don't work. Thank you to help me.
Object.prototype.toMapIt = function(){
var arrayFinal = [];
for(var key in this){
if(key != "toMapIt"){
var array = [];
array.push(key);
array.push(this[key]);
arrayFinal.push(array);
}
}
return new Map(arrayFinal);
}
//Using the method
var object = {key1 : value1, key2 : value2};
var map = object.toMapIt();
So i don't have problem with this :