Prev Demo
Strings == Objects
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <div id="myId"></div> <script> var a = "Sheo Narayan"; // a is a string var b = new String("Sheo Narayan"); // b is an object document.getElementById("myId").innerHTML = a + "<br/>" + typeof b; </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output