From b6b8ae902d9ad7d7e93342d73d156445b027a8f0 Mon Sep 17 00:00:00 2001 From: steak-zhuo Date: Sat, 14 Jan 2023 23:26:26 +0800 Subject: [PATCH] fix the expression --- docs/chapter_data_structure/data_and_memory.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/chapter_data_structure/data_and_memory.md b/docs/chapter_data_structure/data_and_memory.md index 52a666fec..8f3d523c5 100644 --- a/docs/chapter_data_structure/data_and_memory.md +++ b/docs/chapter_data_structure/data_and_memory.md @@ -85,18 +85,16 @@ comments: true ```js title="" // JavaScript 的数组可以自由存储各种基本数据类型和对象 - // JavaScript 的基本数据类型中只有数字, 没有浮点数, 这里使用0.1作为示例 - const array = [0, 0.1, 'a', false] + const array = [0, 0.0, 'a', false]; ``` === "TypeScript" ```typescript title="" // TypeScript 可以定义 JavaScript 数组的类型 - const numbers: number = new Array(5).fill(0); - const decimals: number = new Array(5).fill(0.1); - const characters: string = new Array(5).fill('a'); - const booleans: boolean = new Array(5).fill(true); + const numbers: number = [] + const characters: string = [] + const booleans: boolean = [] ``` === "C"