VS Code tips: Convert ES5 class to ES6 class code action (ok)

Xem them: https://es6console.com/

function Cat(name, age=1) {
	this.name = name;
	this.age = age;
}
Cat.prototype.speac = function() {
	console.log("aaaaaaa");
}
const cat = new Cat("Boris",2);

Result

function Cat(name, age=1) {
	this.name = name;
	this.age = age;
}
Cat.prototype.speac = function() {
	console.log("aaaaaaa");
}
const cat = new Cat("Boris",2);

https://www.youtube.com/watch?v=JNxb9WB-3y4

Last updated

Navigation

Lionel

@Copyright 2023