I am a bit new to Javascript and I would like to know the effective difference between Array.from(string) and string.split('').
const word = 'test';
const arrayFrom = Array.from(word);
const stringSplit = word.split('');
console.log(arrayFrom);
console.log(stringSplit);
In the script above, both logs are exactly the same:
[ 't', 'e', 's', 't' ]
[ 't', 'e', 's', 't' ]
Knowing that, which should I use? Is there any performance advance in using any of them?
[...word]? ;)split()