Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yihan12 authored Dec 14, 2023
1 parent b13bf87 commit 6501e7d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions javascript/Type Casting/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# 类型转换

### 强制类型转换

强制类型转换是将值从一种数据类型自动或隐式地转换为另一种数据类型(例如字符串转换为数字)。类型转换类似于强制类型转换,因为它们都将值从一种数据类型转换为另一种数据类型,只有一个关键的区别——强制类型转换是隐式的,而类型转换可以是隐式的,也可以是显式的。

```javascript
const value1 = "5";
const value2 = 9;
let sum = value1 + value2;

console.log(sum); // '59'
```

0 comments on commit 6501e7d

Please sign in to comment.