DEV Community

mmvergara
mmvergara

Posted on • Edited on

1

Javascript Tagalog - String endsWith Method

Ano ngaba ang String endsWith Method sa Javascript?
yung endsWith method sa javascript ay mag rereturn ng Boolean Value (true or false) depende if yung string is nag e-end sa binigay mong string as an argument

Pano gamitin:
First Argument
yung first argument ay yung string na gusto mo tignan if

x = 'mm vergara'

console.log( x.endsWith('vergara') ) // TRUE

console.log( x.endsWith('ara') ) // TRUE

console.log( x.endsWith('mm') ) // FALSE

Enter fullscreen mode Exit fullscreen mode

Second Argument (optional)
yung second argument is mag dedetermine kung ano length ng string mo, by default yung length is yung length ng string mo (in this ex. is 10).

  • if gusto mo i cut yung string babaan mo yung length using the 2nd argument. tignan monalang pics para magets mo.
//lenght of string is 10
x = 'mm vergara'

// Searching sa "mm vergara"
console.log( x.endsWith('vergara') ) // TRUE

// Searching sa "mm vergar"
console.log( x.endsWith('vergara',9) ) // False

// Searching as "mm verg"
console.log( x.endsWith('vergara',7) ) // False
Enter fullscreen mode Exit fullscreen mode

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

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay