// Case‑insensitive check without a loop, using one return line
function charExistsIgnoreCase(s, target) {
return s.toLowerCase().includes(target.toLowerCase);
}
// Define the string we want to search in
const s = "NodeJSRuntime";
// Perform the case‑insensitive check
const exists = charExistsIgnoreCase(s, "n");
// Print the raw boolean result
console.log(exists);
// Conditional check
if (exists) {
console.log("exists");
} else {
console.log("not exists");
}
/*
run:
true
exists
*/