LoginSignup
0
0

More than 3 years have passed since last update.

javascript 問題集 No.3 関数名(array,callback)

Posted at

function 関数名(array,callback)
を作る問題でした。

最初はcallbackの部分を埋めるために関数をもう一つ作っていました。

けど、こんなやり方もありました。

console.log(arrayの部分,(item)=>{
return item<=20
}

consoleに直接埋め込む方法です。
最初のfunctionにif文を埋め込むだけでできますね。

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