Javascript Tagalog - Math.max

mmvergara

mmvergara

Posted on August 26, 2022

Javascript Tagalog - Math.max

Ano ngaba ang Math.min sa Javascript?
Math Function siya na i re-return yung pinakamataas value sa mga binigay na parameters/arguments (also i ta-try ni js na i convert ang mga binigay na value as a number if hindi number yung binigay)

console.log( Math.max(-1,0,1) ) // -1
console.log( Math.max('3',4,5) ) // 5

const x = [1, 2, 3]
const y = new Set([0,1, 2, 3, 4])

// Using spread operator para mapass mga values as parameters
console.log( Math.max(...y) ) // 4
console.log( Math.max(...x) ) // 3

Enter fullscreen mode Exit fullscreen mode

NaN kapag nag tinry mo mag pass ng hindi number or any na hindi pwede maconvert as a number

console.log( Math.max({}) ) // NaN
Enter fullscreen mode Exit fullscreen mode

More tagalog Javascript Learning Resources:
https://javascript-methods-in-tagalog.vercel.app/

💖 💪 🙅 🚩
mmvergara
mmvergara

Posted on August 26, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Javascript Tagalog - Math.max
javascript Javascript Tagalog - Math.max

August 26, 2022