+ 5
iterator value undefined is not an entry object
I was trying to use Map in this code : https://code.sololearn.com/WzIQsLiSr1mI/?ref=app When I created a small map with about 6 entries it worked but when I added more records it gave me an error. `Uncaught TypeError: iterator value undefined is not an entry object` Is this limit of Map constructor? or something else? any way to fix this? or should I use an object literal as Map like let obj={ key:val, key2:val2, }; //like this.? Thanks.
5 Antworten
+ 2
🇮🇳Omkar🕉 It's working. Check line no 31 . You didn't add ,
and remove , from line no 49
+ 4
Thanks 🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! . I missed comma , 😅
+ 4
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! ,
I probably didn't read you're answer completely or you edited it afterwards. not sure.
"and remove , from line no 49"
~🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ!
comma at end (trailing comma) will not give any errors. it's for convenience of adding new records, elements etc.
●Trailing comma:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas
+ 2
🇮🇳Omkar🕉 It happen in long code 😂
+ 2
🇮🇳Omkar🕉 I know that extra comma will not give any error but it will create empty object which is not necessary.