Why it is undefined? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

Why it is undefined?

https://code.sololearn.com/W4U0cZ5WUru2/?ref=app let str="text"; str.someth=2; console.log(str.someth);

28th Apr 2019, 11:43 AM
Sławek J.
3 Answers
+ 7
28th Apr 2019, 12:07 PM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
+ 6
If any other confusion please reply me. I am always to help.
28th Apr 2019, 12:09 PM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
+ 5
The use of String.prototype.someth Does technically add the property to all strings though.
28th Apr 2019, 4:17 PM
josh mizzi
josh mizzi - avatar