Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ac55595

Browse files
committed
Refactor number formatting and rounding in article.md
1 parent cd7a94f commit ac55595

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22

33
```js run demo
4-
let a = +prompt("The first number?", "");
5-
let b = +prompt("The second number?", "");
4+
let a = +prompt("ตัวเลขแรก?", "");
5+
let b = +prompt("ตัวเลขที่สอง?", "");
66

77
alert( a + b );
88
```
99

10-
Note the unary plus `+` before `prompt`. It immediately converts the value to a number.
10+
สังเกตเครื่องหมายบวกเดี่ยว `+` หน้า `prompt` มันแปลงค่าเป็นตัวเลขทันที
1111

12-
Otherwise, `a` and `b` would be string their sum would be their concatenation, that is: `"1" + "2" = "12"`.
12+
มิฉะนั้น `a` และ `b` จะเป็นสตริง และผลรวมของพวกมันจะเป็นการต่อสตริง เช่น: `"1" + "2" = "12"`

‎1-js/05-data-types/02-number/1-sum-interface/task.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ importance: 5
22

33
---
44

5-
# Sum numbers from the visitor
5+
คุณต้องการให้ผมแปลโจทย์และคําอธิบายนี้เป็นภาษาไทยใช่ไหมครับ? ถ้าใช่ นี่คือคําแปล:
66

7-
Create a script that prompts the visitor to enter two numbers and then shows their sum.
7+
# รวมตัวเลขจากผู้เข้าชม
88

9-
[demo]
9+
สร้างสคริปต์ที่ขอให้ผู้เข้าชมป้อนตัวเลขสองตัว แล้วแสดงผลรวมของตัวเลขเหล่านั้น
1010

11-
P.S. There is a gotcha with types.
11+
[สาธิต]
12+
13+
ข้อควรระวัง: มีจุดที่ต้องระวังเกี่ยวกับประเภทข้อมูล

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /