JavaScript Debug a ML program. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

JavaScript Debug a ML program.

How do I stop the error in the code. Can anyone fix code and tell me that code. Disclaimer: Try it on other compilers don't try in Solo learn as it doesn't support local storage. Like Spck editer. https://code.sololearn.com/WpHZhfls9UBe/?ref=app https://code.sololearn.com/WGEpHjStc8Ns/?ref=app

25th Dec 2022, 10:32 AM
Creative Creations 1
Creative Creations 1 - avatar
2 Answers
+ 3
In the first code "Game Learning ML...", this is the error message I see: "SyntaxError: Invalid shorthand property initializer". This is caused by the malformed objects that are passed to the CreateNodeML function, which should use colons instead of equal sign {key : value} Also in the same code, the savelocally function you are passing (Id) but inside the code block you are passing (id) to the setItem method. Id and id are not the same things. In both codes, the word [length] is misspelled at every line it appears. Something else I notice, in both codes, there several calls to the savelocally and average functions. Both of these functions return a value, but in some cases, you don't assign the return value to a variable. This doesn't cause any syntax errors but may be the cause of unexpected results. As far as the second code is concerned, I don't see any error messages when running your code. Are referring to the warning messages you coded and the errors? I would also like to know if the variable NI is a number or an array or both, switching back and between the two.
25th Dec 2022, 10:19 PM
ODLNT
ODLNT - avatar
+ 1
NI = Node I'd Can you help by editing my code I even tried ChatGPT to do that but didn't work
14th Jan 2023, 3:19 PM
Creative Creations 1
Creative Creations 1 - avatar