There´s a bug in my code and I can´t find it

I´m trying to solve an algorithm problem from Codewars that consists in converting letters to numbers

So far I have been able to get here:

console.log(parseInt("one")) // returns [1]

console.log(parseInt("twenty")) // returns [20]

console.log(parseInt("two hundred forty-six")) // returns [ 3, 100, 40, 4 ]

Ok so by now the only thing my code is doing is iterating through this array:

const leyend = [

And substitute each string for a number. The problem, is i can´t see why if I do this:

console.log(parseInt(“thousand”)) // returns nothing

Wherever in the string there is “thousand” for some strange reason it just does´nt put 1000.

If i put any other number it works. However with “thousand” it does´nt. How this is possible?

Here´s the full code:

thous and
Bug is in the second else if statement

Ohhn right. I just realized. I should make a specific regex better, right?

You can just compare strings using ===