From 55d948eb61e86337ee085bd226b9d131fb2b1e36 Mon Sep 17 00:00:00 2001 From: YangJ0605 <1442122744@qq.com> Date: Wed, 3 Jun 2020 17:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\211\213\345\206\231\345\256\236\347\216\260new.js" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\346\211\213\345\206\231\345\256\236\347\216\260new.js" "b/\346\211\213\345\206\231\345\256\236\347\216\260new.js" index c3f6317..d05fa1f 100644 --- "a/\346\211\213\345\206\231\345\256\236\347\216\260new.js" +++ "b/\346\211\213\345\206\231\345\256\236\347\216\260new.js" @@ -3,5 +3,5 @@ function copyNew(){ const Constructor = [...arguments][0] obj.__proto__ = Constructor.prototype const res = Constructor.apply(obj,[...arguments].slice(1)) - return typeof res === 'object' ? res : obj + return res && (typeof res === 'object') ? res : obj } \ No newline at end of file