0
1

More than 3 years have passed since last update.

split()

特定の文字を引数に渡すとその文字で区切って配列にしてくれる。

var str = 'a k';
var spl = str.split(" "); #引数に入っているのは半角スペース
console.log(spl);

=> [a,k]

join()

配列の区切りを渡した引数に置き換えて文字列に変換する。


var array = ['a','k'];
var ary = array.join("-");

console.log(ary);

=> 'a-k'
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1