I recently started learning JavaScript. but i don't have any Project Experience. Recently attended Interview on JavaScript:
He asked one question about Inheritance
: should be look like this:
I need One Method Called Vehicle
and another two Methods Like one is Two-Wheeler and another one four-wheeler Method.
If I create Instance for those two methods like Below
var two-wheeler1 = new two-wheeler("Shine","125 kph") ;
another instance is like below
var four-wheeler1 = new four-wheller("audi","1000kph");
if I print the
two-wheeler1.getWheeles() //it should print 2 wheels
If i print the
four-wheeler1.getWheeles() //it Should print 4 Wheels
How to achieve this. Could you please any one help me?