DEV Community

mmvergara
mmvergara

Posted on • Edited on

2

Javascript Tagalog - Math.min

Ano ngaba ang Math.min sa Javascript?
Math Function siya na i re-return yung pinakamababang 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.min(-1,0,1) ) // -1
console.log( Math.min('3',4,5) ) // 3

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.min(...y) )
console.log( Math.min(...x) )

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.min( {} ) ) // NaN
Enter fullscreen mode Exit fullscreen mode

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay