当前位置:网站首页>TypeScript:const
TypeScript:const
2022-07-01 14:47:00 【Everything has changed every day】
Use const Defined variables and uses let Defined variables have the same scope , The difference lies in the use const The defined variable cannot be re assigned later :
const a = 1;
a = 2;//error TS2588: Cannot assign to 'a' because it is a constant.But if const Definition is object Or variables of array type , Variables themselves cannot be reassigned , But the object or array represented by the variable can still be modified :
const a = {
data : 1
};
a.data = 2;
console.log(a);// Output { data: 2 }
a = {data : 1};//error TS2588: Cannot assign to 'a' because it is a constant.
const b = [1,2];
b.push(3);
console.log(b);// Output [ 1, 2, 3 ]
b = [4,5,6];//error TS2588: Cannot assign to 'b' because it is a constant.边栏推荐
- Research Report on the development trend and competitive strategy of the global display filter industry
- 关于软件测试的一些思考
- sqlilabs less13
- MIT团队使用图神经网络,加速无定形聚合物电解质筛选,促进下一代锂电池技术开发
- C 语言进阶
- Research Report on the development trend and competitive strategy of the global commercial glassware industry
- Pat 1121 damn single (25 points) set
- Cannot link redis when redis is enabled
- Sqlachemy common operations
- Summary of leetcode's dynamic programming 5
猜你喜欢
![[dynamic programming] interval dp:p1005 matrix retrieval](/img/c9/2091f51b905d2c0ebc978dab3d34d3.jpg)
[dynamic programming] interval dp:p1005 matrix retrieval

Semiconductor foundation of binary realization principle

数据湖系列之一 | 你一定爱读的极简数据平台史,从数据仓库、数据湖到湖仓一体
![[零基础学IoT Pwn] 复现Netgear WNAP320 RCE](/img/f7/d683df1d4b1b032164a529d3d94615.png)
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE

Salesforce, Johns Hopkins, Columbia | progen2: exploring the boundaries of protein language models

2022-2-15 learning xiangniuke project - Section 4 business management

phpcms实现订单直接支付宝支付功能

【14. 区间和(离散化)】

音乐播放器开发实例(可毕设)

Websocket (simple experience version)
随机推荐
[getting started with Django] 13 page Association MySQL "multi" field table (check)
关于软件测试的一些思考
[leetcode 324] 摆动排序 II 思维+排序
深度分析数据在内存中的存储形式
2022-2-15 learning xiangniuke project - Section 4 business management
Error-tf. function-decorated function tried to create variables on non-first call
音乐播放器开发实例(可毕设)
Research Report on development trend and competitive strategy of global 4-aminodiphenylamine industry
Buuctf reinforcement question ezsql
Research Report on the development trend and competitive strategy of the global aviation leasing service industry
首届技术播客月开播在即
JVM performance tuning and practical basic theory part II
Pat 1065 a+b and C (64bit) (20 points) (16 points)
2022-2-15 learning the imitation Niuke project - post in Section 2
After twists and turns, I finally found the method of SRC vulnerability mining [recommended collection]
SQLAchemy 常用操作
Problem note - Oracle 11g uninstall
One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse
券商万1免5证券开户是合理安全的吗,怎么讲
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE