<!DOCTYPE html>
<html>
<head>
<title>javascript01.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
console.log('常用对象Date');
var d = new Date();
window.document.write(d+'<br/>');
document.write(d.getFullYear()+'年'+(d.getMonth()+1)+'月'+d.getDate()+'日<br/>');
console.log('常用对象String');
var str1 = 'abc';
var str2 = new String('abc');
console.log(str1==str2);
var str3 = str1.concat('hello','world');
console.log(str3);
console.log(str3.slice(2, 5));
var str4 = 'what the hell are u doing now?';
console.log(str4.split(' '));
var str5 = '2:3:4';
console.log(str5.split(':'));
var str6 = 'a|b|c|d|e';
console.log(str6.split('|'));
var str5 = 'helloworld';
console.log(str5.substring(2, 5));
console.log(str5.substr(2,5));
var str6 = 'abc123.txt';
console.log(str6.substr(str6.lastIndexOf('.')+1));
console.log('数组');
var arr1 = new Array();
arr1.push('111');
arr1.push(123);
arr1.push('abc');
console.log(arr1);
var arr2 = new Array(111,222,'333','bbb');
console.log(arr2);
var arr3 = [11,33,44,22];
console.log(arr3);
console.log(arr3.join('~'));
console.log(arr3.sort());
console.log(arr3.reverse());
console.log(arr3);
console.log(arr3.splice(2, 0, 66,77));
</script>
</head>
<body>
This is my HTML page. <br>
</body>
</html>