LoginSignup
1
0

More than 3 years have passed since last update.

JSの関数内でIF文がうまく使えない

Last updated at Posted at 2019-06-05

htmlとCSSを一か月ほど独学で学びJSを勉強し始めて一日目なのですが
関数内でIF文がうまく機能しません
エラーが出るわけでもないのですがtrue判定が出なくて困っています。
条件は
i=0
i-1<0
i === 0
と試してみましたがわかりません
疑問解決と後々エラーを見直せるようにQiitaへ投稿したいと考えました。

const choosing =()=>{
let i = Math.round(Math.random()*(listone.length-1));
wone.textContent = listone[i];
if(i == 0){
wtwo.textContent[0]
}else{
let d = Math.round(Math.random()*(listtwo.length-1));
wtwo.textContent = listtwo[d]
};
};

1
0
6

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
1
0