JavaScript Tutorial

Javascript is a most popular Programming language in the world.
In the starting, JavaScript was used for web browser to build the attractive web pages.
After Node came it is used for Web and mobile App, Real time Networking Application like real chat, etc.

Where JavaScript run?

1) Javascript code write into the script tag.

Syntax:-


<script>
// write code

</script>

Write the code into the script tag


<script>
document.write("Hello JavaScript");
</script>

Try it Yourself

It will show on the browser page.

Output:- Hello JavaScript

2) You can javascript run on the browser console.


> console.log("Hello JavaScript");
Output:- Hello JavaScript

Add two numeric value


<script>
document.write(2+2);
</script>

Try it Yourself

Output:- 4

Add two string


<script>
document.write("Welcome"+" John");
</script>

Try it Yourself

Output:- Welcome John

JavaScript Tutorial – Questions and Answers

Q 1: What is JavaScript?

Ans: JavaScript is a client-side scripting language used to create interactive and dynamic web pages.

Q 2: Is JavaScript compiled or interpreted?

Ans: JavaScript is an interpreted language, executed by the browser’s JavaScript engine.

Q 3: Where is JavaScript used?

Ans: It is used in web development, mobile apps, server-side (Node.js), and game development.

Q 4: Can JavaScript run without a browser?

Ans: Yes, using environments like Node.js.

Q 5: Who developed JavaScript?

Ans: Brendan Eich developed JavaScript in 1995.

JavaScript Tutorial – Objective Questions (MCQs)

Q1. JavaScript is a ______ language.






Q2. JavaScript is mainly used to ______.






Q3. JavaScript runs on the ______ side by default.






Q4. Which of the following is a JavaScript engine?






Q5. JavaScript was created by ______.