diff --git a/.gitattributes b/.gitattributes index db4fefa..8a47153 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -*.php linguist-language=JavaScript \ No newline at end of file +*.md linguist-language=JavaScript \ No newline at end of file diff --git a/05-JavaScript进阶/JavaScript开发积累.md b/05-JavaScript进阶/JavaScript开发积累.md index 8794758..0b0f26d 100644 --- a/05-JavaScript进阶/JavaScript开发积累.md +++ b/05-JavaScript进阶/JavaScript开发积累.md @@ -109,3 +109,17 @@ if (result?.user?.name?.length) { +### 2020-04-28-字符串添加白名单 + +```js +if ('str1' == ('str1' || 'str2')){ + console.log('smyhvae); +} +``` + +注意,上面的代码,根本就不会走 console.log语句,因为if里面的内容是false。 + + + + +