From d44f5032d0f53256b2d5aef505d6b593fd3cd158 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:14:18 +0800 Subject: fix yari h2m dry run errors (zh-CN) --- .../web/javascript/equality_comparisons_and_sameness/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'files/zh-cn/web/javascript/equality_comparisons_and_sameness') diff --git a/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html b/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html index 502870405e..d36a7e3aad 100644 --- a/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html +++ b/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html @@ -382,13 +382,12 @@ function attemptMutation(v)

这里是一个会区别对待-0和+0的内置方法和操作符不完全列表:

-

- (一元负)

-
+
- (一元负)

显而易见,对0一元负操作得到-0。但表达式的抽象化可能在你没有意识到得情况下导致-0延续传播。例如当考虑下例时:

-
let stoppingForce = obj.mass * -obj.velocity
+
let stoppingForce = obj.mass * -obj.velocity

如果obj.velocity0 (或计算结果为0), 一个-0就在上处产生并被赋值为stoppingForce的值.

-- cgit v1.2.3-54-g00ecf