0

Sample code not working

Hey guys! I'm in the ES6 portion of the Javascript course. The last 4-6 sample codes have all returned the error "Unexpected end of input." I looked the error msg up on google and found few answers having to do with browser compatibility that I'm not sure I can do anything about. I have 3 browsers on my PC. Safari won't even go to sololearn while Edge and Chrome both return the same error "unexpected end..." Can anyone please offer any solutions that will allow me to complete the course? I haven't tried the corresponding challenges yet, but I don't see how I'll be able to earn my certificate those codes are not able to be processed on sololearn, even if I can complete them in another playground like JSFiddle. Here are some examples of the codes that are not working. BTW I validated these codes at https://beautifytools.com/javascript-validator.php and they all appear to be without errors. Thanks in any case! -Brandon p.s. i just updated Chrome and it still returns the same error. --- let tree = { height: 10, color: 'green', grow() { this.height += 2; } }; tree.grow(); console.log(tree.height); // 12 --- let height = 5; let health = 100; let athlete = { height, // height: height, health // health: health }; console.log(athlete.height); // 5 --- let arr = ['1', '2', '3']; let [one, two, three] = arr; console.log(one); // 1 console.log(two); // 2 console.log(three); // 3 ---

21st Dec 2021, 4:11 AM
Brandon Marino
3 Respuestas
0
Are you creating all your inputs before running the code. Sololearn will only accept multiple inputs if they are all generated before compiling
21st Dec 2021, 4:26 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Ok maybe it's fine? Just ran this up at JSFiddle and brought it all back to SL and it worked fine. Thanks in any case! -B --- let tree = { height: 10, color: 'green', grow() { this.height += 2; } }; tree.grow(); console.log(tree.height); // 12 console.log(); let fork={ tines:3, name: 'McForkerson', doublefork(){ this.tines+=3; } }; console.log(fork.tines); fork.doublefork(); console.log(fork.tines); console.log(); let sayan={ name:"Goku", pwrlvl:9001, supersayan1(){ this.pwrlvl*=100; } }; console.log(sayan.pwrlvl); sayan.supersayan1(); console.log(sayan.pwrlvl); ---
21st Dec 2021, 4:34 AM
Brandon Marino
0
Apparently taking the commented section out did it :D
21st Dec 2021, 4:37 AM
Brandon Marino