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

280
Views
Uncaught Type Error : operation.match is not a function

I am trying to get a user Input and turn that into an array of string to my token. For some reason it is not working.

For Example : Compute(5*6+7) should give token = ["5","**","6","+","7"]

function splitOperation(operation) {
return operation.match(/(\d+(\.\d+)?|[+\-*/])/g);
}
  

function Compute(userInput) {
    let token = [splitOperation(userInput)];
    
    }
    
let userInput = 5*6+7
Compute(userInput)

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

0

5*6+7 is a number.

To use "match" you need a string, use "5*6+7", if your regex is good, this should do it.

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!