誰でもこれに答えることができますか?出力のヘルプが必要
以下のコードはコンソールに出力され、その理由は何ですか?
(function(){
var a = b = 3;
})();
console.log("a defined? " + (typeof a !== 'undefined'));
console.log("b defined? " + (typeof b !== 'undefined'));
以下のコードはコンソールに出力され、その理由は何ですか?あなたのコードの
var myObject = {
foo: "bar",
func: function() {
var self = this;
console.log("outer func: this.foo = " + this.foo);
console.log("outer func: self.foo = " + self.foo);
(function() {
console.log("inner func: this.foo = " + this.foo);
console.log("inner func: self.foo = " + self.foo);
}());
}
};
myObject.func();
'console'への出力以下のコードは、あなたがそれを実行してみました何があるのだろうか? – Justinas
最初のもの:[ここ](https://stackoverflow.com/questions/27329444/whya-a-is-undefined-while-b-is-3-in-var-ab-3)第2のもの:ここに](https://stackoverflow.com/questions/27310385/why-method-of-current-object-in-inner-function-is-undefined) –