Blogger Information
Blog 26
fans 1
comment 2
visits 21773
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
10月21日作业JS部分基础语法练习
星空的博客
Original
590 people have browsed it

一、JS 执行单位为每一行,每行就是一个语句。语句后面带分号结束!

var a = 1+3;

二、JS 变量是对“值”的引用,使用变量等同于引用一个值。每一个变量都有一个变量名。

var wufeng="吴峰";

var hello="你好";

三、JS表达式。

            var  b=20;

            if( c>b){

            alert(“你好!!”);

            }


四、函数:function命令命名的代码区块,便于反复调用.

function hello(){

alert(“你好!!”);

}

hello();


五、匿名函数:

var php= function(){

alert(“到php中文网学习JS”);

}

php();


Correction status:qualified

Teacher's comments:js与php的变量有一个重要的区别, js中的变量需要声明再使用, php不需要
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post