标签:obj java javascrip variable for color var com less
Unlike JavaScript‘s const
variable declarations, TypeScript allows you to create fully immutable types. In this lesson, we learn how to create immutable types in TypeScript with the help of as const
const user = { name: ‘xxx‘, education: { degree: ‘MSc‘ } } as const const users = [ ‘a‘, ‘b‘ ] as const user.education.degree = "BSc" users.push(‘c‘)
[TypeScript] as const, force immutability for Object type
标签:obj java javascrip variable for color var com less
原文地址:https://www.cnblogs.com/Answer1215/p/12364838.html