HackerRank JavaScript Intermediate Text Certification Solution
class Image {
// Add methods here
url;
height;
width;
constructor(url, size){
this.url = url;
this.height = size.height;
this.width = size.width
console.log(size)
}
getUrl(){
return this.url;
}
setUrl(url){
this.url = url;
}
setSize(width,height) {
this.width = width;
this.height = height;
}
getSize(){
return new Size(this.width, this.height)
}
cloneImage(){
return new Image(this.url, new Size(this.width, this.height))
}
}
Comments
Post a Comment