0
I need help for this javascript question.. Plzzz
Find the output of the following JavaScript code snippets. i. var str = "Please locate 'locate' occurs!"; var pos = str.lastIndexOf("locate"); ii. var str = "Please locate 'locate' occurs!"; var pos = str.search("locate"); iii. var str = "Apple, Banana"; var res = str.substr(-4); iv. var fruits = ["Banana", "Orange", "Apple"]; document.getElementById("demo").innerHTML = fruits.join(",");
4 Respostas
+ 1
Do yourself in javascript playground
+ 1
So what's the problem?
+ 1
Show what exactly you tried, since all the examples given work.
You wrote in html: <div id="demo"></div>?
0
Says, Find the output.. I tried them in the editor but showed no output whatsoever & Error.. I am new at this but i dont know what's wrong..