“List testowy JS małe litery” Kod odpowiedzi

List testowy JS małe litery

if (character == character.toLowerCase())
{
  // The character is lowercase
}
else
{
  // The character is uppercase
}
//The problem with this answer is, 
//that some characters like numbers or punctuation 
//also return true when checked for lowercase/uppercase.

// this is the solution for it:
function isLowerCase(str)
{
    return str == str.toLowerCase() && str != str.toUpperCase();
}
Encouraging NeoBliz

Sprawdź, czy ciąg zawiera małe JavaScript

// A minified version of the other one:
const hasLowerCase= s => s.toUpperCase() != s;

console.log("HeLLO: ", hasLowerCase("HeLLO"));
console.log("HELLO: ", hasLowerCase("HELLO"));
Pandata

JS Jeśli tekst zawiera małe litery

function hasLowerCase(str) {
    return str.toUpperCase() != str;
}

console.log("HeLLO: ", hasLowerCase("HeLLO"));
console.log("HELLO: ", hasLowerCase("HELLO"));
Outrageous Otter

Odpowiedzi podobne do “List testowy JS małe litery”

Pytania podobne do “List testowy JS małe litery”

Więcej pokrewnych odpowiedzi na “List testowy JS małe litery” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka