iterator undefined? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

iterator undefined?

returns new Map iterator undefined function main() { var name = readLine(); var position = readLine(); let employees = new Map([ ["Richard", "Developer"], ["Maria", "SEO Specialist"], ["Tom", "Product Manager"], ["David", "Accountant"], ["Sophia", "HR Manager"] ["Bob", "Developer"] ]); //add the new pair to the map employees.set(`name`,`position`) for (var i of employees.entries()){ //your code for the output console.log(i [0] + ":" + i [1]) } }

28th Apr 2021, 12:01 PM
Lee 4 Code
Lee 4 Code - avatar
4 Answers
+ 4
I think you missed a comma after Sophia's entry In employees.set() are some strange quotation marks
28th Apr 2021, 1:17 PM
Lisa
Lisa - avatar
+ 2
Sure? I added a comma after Sophia's entry: https://code.sololearn.com/W3jViq4r8b36/?ref=app
28th Apr 2021, 1:26 PM
Lisa
Lisa - avatar
0
those parts are correct, any other suggestions?
28th Apr 2021, 1:20 PM
Lee 4 Code
Lee 4 Code - avatar
0
Thank you Lisa! i see it now!😀 The key and value and the spacing " : " completed the code
28th Apr 2021, 1:46 PM
Lee 4 Code
Lee 4 Code - avatar