New course! Every coder should learn Generative AI!
Try a free lesson+ 1
I tried converting a Python program to JavaScript but I'm not getting the same result, please help...
I expected "958" as the result in the JavaScript code but I'm getting an object as the answer What's wrong with my JavaScript code? https://code.sololearn.com/cdz8QCS9MNlP/?ref=app https://code.sololearn.com/cS1b9F9SuSYW/?ref=app
4 Answers
+ 2
New node creation : just do like
add_at_front(data) {
this.head = new node(data,this.head);
}
curr.next = new node(data);
+ 1
Jayakrishna🇮🇳 thank you for the insight
Now I'm trying to make the output be on a straight line, just the way I recently edited it in python.
I've made an attempt for that of JavaScript but is there a better way it can be written to make it similar to the way it was written in python to make the output be on a straight line?
+ 1
You already done it..!?! Same output.
You're welcome..
+ 1
Alright Sir/Ma, thank you Jayakrishna🇮🇳