mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-10 17:00:45 +08:00
Merge pull request #252 from zhuoqinyue/master
Add Typescript and Javascript examples in data_and_memory.md
This commit is contained in:
@ -84,13 +84,17 @@ comments: true
|
||||
=== "JavaScript"
|
||||
|
||||
```js title=""
|
||||
|
||||
/* JavaScript 的数组可以自由存储各种基本数据类型和对象 */
|
||||
const array = [0, 0.0, 'a', false];
|
||||
```
|
||||
|
||||
=== "TypeScript"
|
||||
|
||||
```typescript title=""
|
||||
|
||||
/* 使用多种「基本数据类型」来初始化「数组」 */
|
||||
const numbers: number[] = [];
|
||||
const characters: string[] = [];
|
||||
const booleans: boolean[] = [];
|
||||
```
|
||||
|
||||
=== "C"
|
||||
|
Reference in New Issue
Block a user