I wanted my myResult = [ ’40’, ‘-‘, ‘(‘, ’60’, ‘*’, ‘2’, ‘)’ ]
let myInput = '40-(60*2)';
let myResult = myInput.split(/([*/+-])/);
console.log(myResult)
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
I wanted my myResult = [ ’40’, ‘-‘, ‘(‘, ’60’, ‘*’, ‘2’, ‘)’ ]
let myInput = '40-(60*2)';
let myResult = myInput.split(/([*/+-])/);
console.log(myResult)