2019年4月21日

摘要: 在main函数中调用: 阅读全文
posted @ 2019-04-21 13:09 A_free 阅读(76) 评论(0) 推荐(0)
摘要: var role = {}; function test_func(name,sex){ this.name=name; this.sex=sex; } // 显式传递this // 函数.call可以显式的传递一个实例,函数中的this就是指这个实例// 在这里this--->role test_func.call(role,"leon","男"); console.log(role);... 阅读全文
posted @ 2019-04-21 13:04 A_free 阅读(90) 评论(0) 推荐(0)
摘要: console.log("Hello World"); console.log(Math.PI); var str="leon"; // 字符串 console.log(str.length); // 获取字符串长度 var index = str.indexOf("o"); // 字符串中是否含有某字符,含有返回该字符串出现的index,没有则返回... 阅读全文
posted @ 2019-04-21 12:54 A_free 阅读(101) 评论(0) 推荐(0)

导航