Thursday, July 27, 2017

TS2345:Argument of type 'string' is not assignable to parameter of type 'RegExp'.

The problem with the following code is that it does not use two strings. One of the variables is of the wrong type.

let liar = 13;
let billiards = 'billiards';
let whatever = billiards.replace('liar', liar);

No comments:

Post a Comment