文字列の長さを返します。
var uname = new String("Hello World") console.log(uname) console.log("Length "+uname.length) //returns the total number of characters //including whitespace
コンパイル時に、JavaScriptで同じコードが生成されます。
その出力は次のとおりです-
Hello World Length 11