Whenever I use toLowerCase() in JavaScript, I seem to always have problems such as typeError: "x" is not a function.
Ex.
var x = "Pie";
if (x.toLowerCase() = "pie") {
// Code isn't executed
}
use this
var x = "Pie";
if (x.toLowerCase() == "pie") {
// Code isn't executed
}
notice the double equal ( ==
) or you can use ( ===
).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.