[TS] Class Properties Public, Private and Read Only Modifiers
2024-08-27 11:02:02
In the constructor, we want to set the prop to readonly, you need to do like this:
class Superhero { readonly name: string constructor(
name: string,
editor: string,
createdYear: number
) { name = this.name;
}
}
最新文章
- css整理-05 边框,背景和浮动,定位
- Android Handler处理机制 ( 二 ) ——Handler,Message,Looper,MessageQueue
- android 4.3源码编译
- Linux学习之进程管理
- SQL Server 完成性检查的顺序
- jail brak 获取当前安装app列表
- MongoDB--在windows下的安装过程及基本配置
- JavaScript继承的几种实现
- css3 手风琴
- vue分页效果
- 理解DeepBox算法
- 查看文件内容 cat , tac
- js中的数值转换
- appium安装完成后运行和执行python脚本的错误合集
- 【读书笔记】iOS-使用蓝牙
- java类中使用quartz,设置自动任务Demo
- triplet改进,变种
- python -m SimpleHTTPServer 8080
- django项目中使用项目环境制作脚本 通过终端命令运行脚本文件
- Eclipse中各种编码格式及设置