The code is written through the ExtJS framework and can be copied directly into a function in JS, which is called via HTML
Ext.onready (function(){ //JavaScript data type: Number,string,boolean,object,undefined,function // Number varNUM1 = 10; varnum2 =. 6;//0.6 varNUM3 = 070;//octal varNUM4 = 1/0; Positive InfinityvarNUM5 = Window.parseint ("10data");//are characters that show NaN (you and yourself are not equal) Debugger; //Object vardata =NewDate (); vararr =NewArray (); varobj = {name: "Shang Academy", Age:10}; varm = Alert (Obj.hasownproperty ("name"));//returns True varresult =Obj.tosource (); Alert (typeofresult);//execution stops here, String Debugger; //Undefined declared but not assigned, equivalent to null varA; alert (a);//UndefinedAlert (a==NULL);//= = Judgment value, = = = Type and value, TrueAlerttypeof NULL);//represents a reference to an empty object, object //Function functionFun () {Console.info ("Fun"); } alert (typeofFun);//Function});
JavaScript (i) Basic data types