Basic concepts in java script programming
-
Use curly brackets to create JSON like JavaScript object and add properties and functions to the object.
-
Understand the ‘this’ keyword in JavaScript.
Declare a global variable named vehicleName in the window objec Declare a method named printVehicleNameto print out the vehicle name Declare an object named Vehicle(using object literal notation) which have a variable called vehicleNameand declare a function named getVehicleNameand assign it with theprintVehicleName Execute the printVehicleName function and the getVehicleName functions to see the results Correct the getVehicleName to print out the global variable vehicleNameusing the this keyword
-
Create a separate function using JavaScript closurewhich accepts the tax percentage and returns a function which accepts the amount and returns the amount after adding tax percentage. Try adding tax percentage to ‘this’object and check if it works.
-
Write a function to call GitHub API (https://api.github.com/users) and get users and return the users to the caller.