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

207
Views
cómo verificar que existe una palabra específica en una matriz de objetos
my_arr = [ { "keywords": "set,on,increease,decrease,low,medium,high,forward,backward", "commands": "SET" }, { "keywords": "get,access,retrieve", "commands": "GET" }, { "keywords": "run", "commands": "RUN" }, { "keywords": "stop", "commands": "STOP" } ]

¿Quiero saber si existe un aumento en las palabras clave?

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

0

¿Qué tal algo como esto?

 const data = [ { "keywords": "set,on,increase,decrease,low,medium,high,forward,backward", "commands": "SET" }, { "keywords": "get,access,retrieve", "commands": "GET" }, { "keywords": "run", "commands": "RUN" }, { "keywords": "stop", "commands": "STOP" } ] const keywordExists = keyword => data.flatMap(({keywords}) => keywords.split(',')).includes(keyword) console.log(keywordExists('increase')) console.log(keywordExists('decrease')) console.log(keywordExists('not valid keyword'))

about 4 years ago · Juan Pablo Isaza Report

0

Creo que esto debe ser trabajo.

 const keys = [ { "keywords": "set,on,increease,decrease,low,medium,high,forward,backward", "commands": "SET" }, { "keywords": "get,access,retrieve", "commands": "GET" }, { "keywords": "run", "commands": "RUN" }, { "keywords": "stop", "commands": "STOP" } ] function check(value) { // On every value on keys get index for (let i in keys) { // Get key from keys with index value const key = keys[i]; // Check if is matching if (key.keywords.split(',').includes(value)) // If successfuly matching is found return commands value return key.commands; } // If any result doesnt returned, return null. return null; }
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!