.split
3328 ワード
文字列を入力するとき.文字列をsplitメソッドで分割する基礎機能.
やりたかったんだ
文字列が別々であることを確認できます.
そして.split(''); 「」の間を移動しない場合
すべての文字が1文字に分かれていることを確認します.
やりたかったんだ
function test1(str){
let test2 = str;
test2.split(' ');
return test2.split(' ');
}
let output = test1('kim yong hee');
console.log(output);

文字列が別々であることを確認できます.
そして.split(''); 「」の間を移動しない場合
function test1(str){
let test2 = str;
test2.split('');
return test2.split('');
}
let output = test1('kim yong hee');
console.log(output);

すべての文字が1文字に分かれていることを確認します.
Reference
この問題について(.split), 我々は、より多くの情報をここで見つけました https://velog.io/@yonghk423/.splitテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol