let yin: Array<string> = ["foo", "bar", "baz", "quz"];
let yang: Array<string> = ["doe", "ray", "me"];
let yinYang: Array<string> = [...yin, ...yang];
console.log(yinYang);
...does the same thing as:
let yin: Array<string> = ["foo", "bar", "baz", "quz"];
let yang: Array<string> = ["doe", "ray", "me"];
let yinYang: Array<string> = yin.concat(yang);
console.log(yinYang);
The .concat exists in JavaScript itself!
No comments:
Post a Comment