LoginSignup
0
0

More than 3 years have passed since last update.

プログラミング初学者備忘録 javascriptのsplitでつまずいた

Posted at

readlineで出力しようとしたらsplit is not a function.出てため息。

const lines = ['300 200 100']
const hairetu = lines.split(" ");

この書き方でsplit()使ったがエラー

const hairetu = (String(lines).split(" "));

で解決

原因

ちゃんと型宣言してあげてなかったから起こったので気をつけます

0
0
1

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
0