Baseline Widely available
null
ã¨ããå¤ã¯ãæå³çã«ãªãã¸ã§ã¯ãã®å¤ãåå¨ããªããã¨ã表ãã¾ãããã㯠JavaScript ã®ããªããã£ãå¤ã® 1 ã¤ã§ãããè«çæ¼ç®ã§ã¯å½å¤ã¨ãã¦æ±ããã¾ãã
function getVowels(str) {
const m = str.match(/[aeiou]/gi);
if (m === null) {
return 0;
}
return m.length;
}
console.log(getVowels("sky"));
// Expected output: 0
æ§æ 解説
null
å¤ã¯ null
ã¨ãããªãã©ã«ã§ãã null
㯠undefined
ã®ãããªã°ãã¼ãã«ãªãã¸ã§ã¯ãã®ããããã£ã§ã¯ããã¾ããã代ããã«ã null
ã¯èå¥ã§ããªããã¨ã表ãã夿°ããªãã¸ã§ã¯ããæãã¦ããªããã¨ã示ãã¾ãã API ã«ããã¦ã¯ãé常ã¯ãªãã¸ã§ã¯ããè¿ãããã¨ããã§ãé¢é£ãããªãã¸ã§ã¯ãããªãå ´åã« null
ãããæ¸¡ããã¾ãã
// foo ãåå¨ãããå®ç¾©ãåæåãããã¦ããªãå ´å:
foo; //ReferenceError: foo is not defined
// foo ãåå¨ãã¦ããããåãå¤ãæããªãå ´å:
var foo = null;
foo; //null
ä¾ null
㨠undefined
ã®éã
null
ã undefined
ããã§ãã¯ããéã¯ãç価 (==) 㨠å³å¯ç価 (===) æ¼ç®åã®éã ã«æ³¨æãã¦ãã ããï¼åè
ã§ã¯å夿ãè¡ããã¾ãï¼ã
typeof null; // "object" (æ´å²çãªçç±ã§ "null" ã§ã¯ããã¾ãã)
typeof undefined; // "undefined"
null === undefined; // false
null == undefined; // true
null === null; // true
null == null; // true
!null; // true
isNaN(1 + null); // false
isNaN(1 + undefined); // true
仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4