Blogger Information
Blog 17
fans 0
comment 0
visits 13709
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Javascript 基本语法(字面量,变量,操作符,函数)的学习9月11号
18674060620的博客
Original
726 people have browsed it

这节课学习了javascript的字面量,变量,函数等的基本语法,它的语法跟php还是比较像的,目前学起来还算跟得上老师的思路!

编程: 创建对象的方式(字面量或构造函数)

实例

<script>
//构造函数来创建对象
    function Person(name, sex) {
		var a = 100000;
        this.name = name;
        this.sex = sex;
		this.outputa = function(){
			console.log(a);
		}
    }

    var p1 = new Person('张三','男');
    console.log(p1);
	p1.outputa();
	
	
</script>
<script>
//使用字面量方法创建对象:
let php=['朱老师','朱老师2','朱老师'];
console.log(php);
//alert(php);
alert(php['0']);

</script>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:qualified

Teacher's comments:下次记得把自己的总结加上
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