How to use a variable in in an object in a javascript class ?
- Yogesh Kumar
- 03-May-2022
- 0
Remove functions
:
class Example{
constructor(something){
this.something = something;
}
foo(){
return this.something
}
}
const object = new Example("among")
console.log(object.foo())
320 0
7
* Be the first to Make Comment