Finds a needle in a haystack

PHOTO EMBED

Thu Feb 23 2023 10:53:15 GMT+0000 (Coordinated Universal Time)

Saved by @AlanaBF #javascript

function findNeedle(haystack) {
  const indexOfNeedle = haystack.indexOf("needle");
 return haystack.includes("needle"), `found the needle at position ${indexOfNeedle}`;
}
content_copyCOPY