function max(a, b) {
if( a > b )
return a;
else
return b;
}
var max = inc(1, 10);
console.log(' 1 跟 10 誰比較大?' + max);
// 1 跟 10 誰比較大? 10
var html = "<html> \
<head><title>我是一個網頁</title></head> \
<body><h1>現在時間" + (new Date()) + "</h1></body> \
</html>";
document.write(html);
var name = "喵喵";
var age = 20;
function profile() {
console.log('大家好我是', name, ',我今年', age, '歲喔。_。');
}
var cat = {
name = "喵喵",
age = 20
showProfile: function() {
console.log('大家好我是', this.name, ',我今年', this.age, '歲喔。_。');
}
};
cat.showProfile();
//物件導向
turtle.turnTo banana
turtle.step 10
monkey.turnTo banana
monkey.step 10
turtle.eat monkey
//程序導向
step turtle, 10
turnTo monkey, banana