My code includes the following-
if(!code1.startsWith(("<video" || "<img"))){return ...}
The code only checks if code1 doesn’t start with "<video". If the "<video" is false and "<img" is true, it executes the return code.
I am still a learner and hoping for help.
>Solution :
it is not supposed to behave like that; but you can achieve it this way:
if (!(code1.startsWith("<video") || code1.startsWith("<img"))) {
return ...
}
The code above checks that code string NEITHER starts with <video NOR
<img – so if it starts with either, return …