Replacing it all in code playground

It says that the function was called too many times. Please help

1 Like

Hi there,
You got double-brackets in your code.
My experience with triple and quadruple brackets make me delete them along with attached code and type away again
So I guess they appear more than once if you DONT select the last piece/word of code or the program doesn’t work if you select the whole phrase of code.
Maybe I’m wrong but hey do try removing them if more than once ok!
Cheers!

1 Like

Hey there, change the line:

if (string.includes(oldpart === false))

to

if (string.includes(oldpart) === false)

That should fix the problem. Hope this helps!
Ben

2 Likes

Oh that might explain why the first return command was not executed due to which only the second return command ran for ever. Thank you Ben