Hackerank Es6
Hackerank Es6
Hackerank Es6
Define Chennai and Chandigarh variables using Destructuring so that variables Chennai =
['Tamilnadu'], Chandigarh = ['Punjab', 'Haryana']
Solution:
class Car {
constructor(name, distance)
{
this.name=name;
this.distance=distance;
}
carDistance()
{
return this.name +'had travelled for ' + this.distance + '
miles';
This study source was downloaded by 100000844313934 from CourseHero.com on 03-28-2022 03:40:24 GMT -05:00
https://www.coursehero.com/file/68103783/hackerank-es6docx/
}
}
let Car1 = new Car('Audi', 100);
const msg = Car1.carDistance();
console.log(msg);
module.exports = {msg}
This study source was downloaded by 100000844313934 from CourseHero.com on 03-28-2022 03:40:24 GMT -05:00
https://www.coursehero.com/file/68103783/hackerank-es6docx/
Powered by TCPDF (www.tcpdf.org)