JSエラー:キャッチされていないSyntaxError:無効な省略形プロパティ初期化子
Js Error Uncaught Syntaxerror
これがjsを参照していると理解されている場合、varの場合、オブジェクトのプロパティは突然気まぐれなオブジェクトになります。等号、
見つかりません。タイトルにエラーが発生します。オブジェクトのプロパティにも注目すべき点があります。
それらの中には、使用、分割オープン、離れていないことを覚えておいてください、これは私がよくするいくつかの小さな間違いです
プロパティがオブジェクトにアクセスするために、それを使用することができます。 A.funアクセス
もちろん、オブジェクトはアクセスされる['fun']を使用してjsonとして見ることができます
コードは次のとおりです。
var objName='I'm a window of the name' function obj(){ var objName='this is my name ' console.log(this) //window console.log(this.objName) } // expressed here do not understand this, what is the meaning of this format // preliminary understood as an object, a representative value of a property corresponding thereto a plurality of attributes, can be separated var a={ fun:obj, // Here parentheses and brackets without distinction ??? objName:'this is a 'a ' method' } obj() a.fun()