[JavaScript] 소문자로 변환 - String.prototype.toLowerCase()
Post

[JavaScript] 소문자로 변환 - String.prototype.toLowerCase()

toLowerCase()

  • 문자열의 대문자를 소문자로 변환
  • 검색 처리 시 검색 값과 데이터 모두 toLowerCase를 적용시키고 필터링하면 이용자가 더 많은 검색결과를 얻을 수 있음
const sentence = 'The quick brown fox jumps over the lazy dog.';

console.log(sentence.toLowerCase());
// expected output: "the quick brown fox jumps over the lazy dog."

Reference