LoginSignup
18
12

More than 5 years have passed since last update.

文字列を一文字ずつ分割して配列に入れる[Javascript]

Posted at

普通のやり方

let str = 'test'
str.split('') // ['t', 'e', 's', 't']

Array.from() を使ったやり方

let str = 'test'
Array.from(str) // ['t', 'e', 's', 't']

Array.from()

18
12
3

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
18
12