I am working on javascript with jshint esversion 11. I have a function to get the language of the application. I have this code to get it but jshint is throwing an error.
Code
let localeToReturn = navigator?.language?.split("-")[0].toUpperCase()
The JSHint is giving an issue in-between "split" and "(".
navigator?.language value is like "en-us".
I am not sure what it is.
Let me know if more details are needed