Warning: Undefined array key "fancybox" in /home/techback/techback.info/public_html/wp-content/plugins/responsive-lightbox/includes/class-frontend.php on line 85
Warning: Undefined array key "fancybox" in /home/techback/techback.info/public_html/wp-content/plugins/responsive-lightbox/includes/class-frontend.php on line 88
Warning: Trying to access array offset on value of type null in /home/techback/techback.info/public_html/wp-content/plugins/responsive-lightbox/includes/class-frontend.php on line 88
変換
文字を大文字・小文字に変換
const text = "a" ;
// 大文字に変換
const upperText = text.toUpperCase() ;
console.log(upperText)
// 小文字に変換
const lowerText = upperText.toLowerCase() ;
console.log(lowerText)
> "A"
> "a"
判定
null判定
値がセットされていた場合のみ処理したい場合など、よく使う方法です。
let data = null;
if (!!data){
// nullなのでここには入ってこない
console.log('1')
}
data = '';
if (!!data) {
// 空なのでここには入ってこない
console.log('2')
}
data = 'a';
if (!!data) {
console.log('3')
}
雑感
常に付いて回る文字列周りの処理について。