Ignoring that you don't show us the exact code you used to get the error, but if you get an error message you don't understand, google it:
Uncaught RangeError: Incorrect locale information provided at String.toLocaleUpperCase - Google Search[
^]
The first link explains why you get the error:
String.prototype.toLocaleUpperCase() - JavaScript | MDN[
^]
Either you are specifying an invalid locale when you call it, or your browser Locale setting is wrong.
It's entirely possible you are trying to call toLocaleUppercase without reading the documentation and passine the string to be converted as the function parameter - but we can;t see your code, so we will never know ...
Quote:
hello sorry, my bad. I forgot to edit the code after I pasted it. It's now updated.
And what did I say?
"It's entirely possible you are trying to call toLocaleUppercase without reading the documentation and passine the string to be converted as the function parameter"
That's exactly what you are doing:
sentence2.toLocaleUpperCase(sentence2)
If you look at the documentation, the parameter is an optional Locale string to specify exactly which Locale to use, overriding the browser setting. You don;t pass your string to convert!
Try:
console.log(sentence2.toLocaleUpperCase());