我想知道由empty
构建的"".split("\n")
的价值是什么。
这是我找到它的试验。
var empty = "";
empty = empty.split("\n");
console.log("Is empty's length one? ")
console.log(empty.length === 1);
console.log("------");
console.log("Is empty's first value is a empty string (\"\")? ");
console.log(empty[0] === "");
console.log("------");
console.log("Then what is the constructor of empty? ");
console.log(empty.constructor.name);
console.log("------");
console.log("Is empty === [\"\"]? ");
console.log(empty === [""]);
console.log("------");
console.log("Is empty == [\"\"]? ");
console.log(empty == [""]);
console.log("------");
console.log("Then what is empty? ");
console.log(empty);

如您所见,空的长度为1,其值为空字符串
问题是,为什么它不等于[""]
,它的价值是多少?