Question 01

Create a function as a variable (function expression) that prints ‘Hello World’ to console and another function which accepts a variable. The argument passed to the second function should be executed as a function inside the body. Call the second function passing the first function as the argument. Check the output.


Question 02

 Declare a global variable named "vehicleName in the window object.

 Declare a method named printVehicleName to print out the vehicle name .

 Declare an object named Vehicle(using object literal notation) which have a variable called vehicleName and declare a function named getVehicleName and assign it with the printVehicleName  Execute the printVehicleName function and the getVehicleName functions to see the results.

Correct the getVehicleName to print out the global variable vehicleName using the this keyword.

Question 03

Create a separate function using JavaScript closure which 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.

Question 04

Write a function to call GitHub API (https://api.github.com/users) and get users and return the users to the caller



ANSWERS FOR THE ABOVE QUESTIONS ARE GIVEN BELOW













JavaScript is one of the 3 languages all web developers must learn:

   1. HTML to define the content of web pages
   2. CSS to specify the layout of web pages
   3. JavaScript to program the behavior of web pages

Web pages are not the only place where JavaScript is used. Many desktop and server programs use JavaScript. Node.js is the best known. Some databases, like MongoDB and CouchDB, also use JavaScript as their programming language.

ABOUT CHALLENGE

We are conducting a marathon competitive programming challenge June Circuits starting from 16th June 2018. The objective of June Circuits is to challenge the talented and creative minds in competitive programming with some interesting algorithmic problems.
The participants will be challenged by Multiple Problem Setters with 8 problems of varying difficulty levels in a duration of 9 days. Here is the detailed time line of the challenge,
  • Day-0 : Problem-1 (Easy) , Problem-2 (Easy),Problem-3 (Approximate)
  • Day-2 : Problem-4 (Easy-Medium) , Problem-5 (Medium)
  • Day-4 : Problem-6 (Medium) , Problem-7 (Medium-Hard)
  • Day-6 : Problem-8 (Hard)
  • Day-9 : Challenge Ends
We will publish a new set of problems every 48 hours (Very Easy, Easy, Medium, Hard).
The smartest ones will be awarded amazon gift vouchers,
  • First Prize: $100
  • Second Prize: $75
  • Third Prizes: $50
Top 5 will also win HackerEarth T-shirts.
Note:
- In order to be able to claim your prizes, your HackerEarth profile must be completed more than 50% (Location details of the hacker is a must to claim the prizes).
- The prizes will be disbursed in the first week of the following month.
- Ratings of the particular challenge will be updated in the user profile within 5 days after the challenge is over


Link https://www.hackerearth.com/challenge/competitive/june-circuits-18/

Write HTML Using Notepad or TextEdit

Web pages can be created and modified by using professional HTML editors.
However, for learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac).
We believe using a simple text editor is a good way to learn HTML.
Follow the four steps below to create your first web page with Notepad or TextEdit.

Step 1: Open Notepad (PC)

Windows 8 or later:
Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.
Windows 7 or earlier:
Open Start > Programs > Accessories > Notepad

Step 1: Open TextEdit (Mac)

Open Finder > Applications > TextEdit
Also change some preferences to get the application to save files correctly. In Preferences > Format > choose "Plain Text"
Then under "Open and Save", check the box that says "Display HTML files as HTML code instead of formatted text".
Then open a new document to place the code

Step 3: Save the HTML Page

Save the file on your computer. Select File > Save as in the Notepad menu.
Name the file "index.htm" and set the encoding to UTF-8 (which is the preferred encoding for HTML files).


Step 4: View the HTML Page in Your Browser

Open the saved HTML file in your favorite browser (double click on the file, or right-click - and choose "Open with").


With HTML you can create your own Website.This tutorial teaches you everything about HTML.
HTML is easy to learn - You will enjoy it.

  • The <!DOCTYPE html> declaration defines this document to be HTML5
  • The <html> element is the root element of an HTML page
  • The <head> element contains meta information about the document
  • The <title> element specifies a title for the document
  • The <body> element contains the visible page content
  • The <h1> element defines a large heading
  • The <p> element defines a paragraph

HTML Tags

HTML tags are element names surrounded by angle brackets:
  • HTML tags normally come in pairs like <p> and </p>
  • The first tag in a pair is the start tag, the second tag is the end tag
  • The end tag is written like the start tag, but with a forward slash inserted before the tag name

Web Browsers

The purpose of a web browser (Chrome, IE, Firefox, Safari) is to read HTML documents and display them.
The browser does not display the HTML tags, but uses them to determine how to display the document:

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.
It must only appear once, at the top of the page (before any HTML tags).
The <!DOCTYPE> declaration is not case sensitive.

Try the code given below in an IDE. One of the most recommended IDE is Visual Code. You can download it from the given link below
https://code.visualstudio.com/download

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

 Output of the code should be like this