mirror of
https://github.com/zhigang1992/is-thirteen.git
synced 2026-04-28 20:15:26 +08:00
Add binary support
This commit is contained in:
4
index.js
4
index.js
@@ -18,6 +18,10 @@ function isThirteen(n, strictEquality) {
|
||||
if (n === "тринадцать") return true;
|
||||
if (n === "Тринадцать") return true;
|
||||
|
||||
// 13 as binary. 1101 or '1101'.
|
||||
if(n === Number(13).toString(2)) return true;
|
||||
if(n === parseInt(Number(13).toString(2))) return true;
|
||||
|
||||
return (strictEquality === true) ? n === 13 : n == 13;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user