You seem to be confused about what values are returned from the match method. I would console.log(str.match(consonant)) before the let result = line, so you understand the possibly values of it before trying to using it in the way you are currently doing.
To check if there was a match, you should check if consonant is not null. null is returned by str.match() if there was no match.
So, you need to change the condition from str.match(consonant) === true to consonant !== null.