Copy the code code as follows:
<html>
<head>
<title>Definition of string in javascript</title>
<script>
//Define string
//First type
var str = new Array();
alert(str);//null character
//Second type
var str2 = new Array("hello");
alert(str2);//hello
//Third type
/*
String objects can be created explicitly using string literals.
String objects created in this way (in standard string form) are handled differently from String objects created using the new operator.
All string literals share a common global string object. If you add a property to a string literal, it is available to all standard string objects:
*/
var str3 = "hello";
alert(str3);//hello
</script>
</head>
<body>
</body>
</html>