“VEVO” Code-Antworten

VEVO

if (typeof window !== 'undefined') {
    console.log('we are running on the client')
} else {
    console.log('we are running on the server');
}
Strange Starling

VEVO

const getLanguage = () => navigator.userLanguage || (navigator.languages && navigator.languages.length && navigator.languages[0]) || navigator.language || navigator.browserLanguage || navigator.systemLanguage || 'en';

console.log(getLanguage());
Strange Starling

VEVO

if (typeof window !== 'undefined') {
    localStorage.setItem('myCat', 'Tom');
}
Strange Starling

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen