Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

77
Views
Check whether url from api data contain a particular string

I have my JSON data from API stored in map now one of its data is named with URL and contains URL of the sites I have to check whether the URL contains a particular string or not so that I can apply different styling to the div on HTML

let x = `${ values.url }`;
      if (x.contains("codeforces")) {
        console.log("Yes");
      }

I am getting error while using this:

console error

Please help me with this.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think you want to use includes function. There is no function called contains

let x = values.url;
  if (x.includes("codeforces")) {
    console.log("Yes");
  }

Let me know if it helps :)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!