//一般的java的语法是: 类型 变量 = 内容 ; 而JavaScripe 的语法简单,可以不用类型直接编写变量,
// 变量的类型直接可以根据变量的内容来推断
temp = 10; // temp 是整型
temp = 12.3; // 修改类型
alert(temp + temp); //结果是24.6
//而JavaScripe的语法没有这么严格...逻辑性不强
var temp1 = 10;
temp1 = "100";
alert(temp1 + temp1);
//在JavaScripe定义全局变量的时候,才使用var;
var temp2 = "hello ,";
temp2 = "xiaoming"
alert(temp1 == temp2);
//比较字符串是否相等就这么简单。。。
var temp3 = "";
temp4 = "";
alert(temp3 != null); //true
alert(temp3 == ""); //true
//没有equals 方法的
var temp5 = "hello";
temp6 = temp5.replace("1","_");
window.alert(temp6);
//取从第一个(也就是第二个)到第2 个字符,显示
alert(temp6.substring(1,2));