From 9c1007c29295d47305081062d23df87ab9d3d825 Mon Sep 17 00:00:00 2001 From: qianguyihao Date: Sun, 3 May 2020 08:54:37 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=20=E5=B0=86=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E8=AF=86=E5=88=AB=E4=B8=BAjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 +- 05-JavaScript进阶/JavaScript开发积累.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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。 + + + + +