JS函数语法

if(typeof person.age=="name")判定类型

var person = {};
Object.defineProperty(person, "name", {
writable: false,
value: "Nicholas"
});


不使用 new 操作符调用 Person()会出现什么结果:属性和方法都被添加给 window
对象了。有读者可能还记得,当在全局作用域中调用一个函数时, this 对象总是指向 Global 对象(在
浏览器中就是 window 对象)

var o = new Object();
Person.call(o, "Kristen", 25, "Nurse");
o.sayName(); //"Kristen"

this.sayName = function(){
alert(this.name);
};

this.sayName = new Function("alert(this.name)"); // 与声明函数在逻辑上是等价的
}

delete person1.name;

动态设置样式:
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = "style.css";
var head = document.getElementsByTagName("head")[0];
head.appendChild(link);

[g=f(x) ]

(k(x)+p(x))

原文地址:https://www.cnblogs.com/webdev8888/p/8884033.html