Tuesday, February 14, 2017

Javascript Class basics - ECMA Script 6

This is a tutorial on the 1st lab session of application frameworks subject conducted by pearson lanka for the SLIIT 3rd year first semester.

Basically the first activity is to write a program in java script to update the div in realtime as we type on. for this, the ideal javascript function is "oninput".


























The 2nd activity is to create a JavaScript class called Vehicle and Car. Car class should extend from Vehicle class. Vehicle class should have a method to set and price of the Vehicle.

Type the following html and include the automobile.js as given below














Then let's type the below code to achieve the results. Here I have used the latest version of the javascript.






































Finally save this file and run it. The next activity is to consume the GitHub api to get a list of users. This will be posted soon. Stay tuned!

You can get the full answers via this link

5 comments: