DEV Community

Cover image for What is JavaScript
Stackfindover
Stackfindover

Posted on • Updated on

What is JavaScript

Who invented JavaScript, how it works, as we have given information about Programming language in our previous article ( What is PHP ), but today we will talk about what is JavaScript, why JavaScript is used The Answers to all such questions and much other information about JavaScript, you are going to get here today. Hope this information will work for you.

Who invented JavaScript?

JavaScript language was invented by Brendan Eich in 1995. JavaScript is inspired by Java Programming Language. The first name of JavaScript was Mocha which was named by Marc Andreessen, Marc Andreessen is the founder of Netscape and in the same year Mocha was renamed LiveScript, and later in December 1995, it was renamed JavaScript which is still in trend.

What is JavaScript?

JavaScript is a client-side scripting language used with HTML (Hypertext Markup Language). JavaScript is an Interpreted / Oriented language called JS in programming language JavaScript code can be run on any normal web browser. To run the code of JavaScript, we have to enable JavaScript of Web Browser. But some web browsers already have JavaScript enabled.

How to add javascript code in HTML?

The code of JavaScript is written between <script> tags, but it is not necessary that ‘script tags‘ be written between ‘head tags‘ JavaScript code can be implemented anywhere on the web page to implement the code of JavaScript.

What is the type attribute used for

The ‘type’ attribute is commonly used in the script tag. What type of content is given here is written.

<script type="text/javascript">
     // Here we have to code JavaScript
</script>
Enter fullscreen mode Exit fullscreen mode

How to comment JavaScript code?

  1. For single line comment in JavaScript we have to use // (double slashes)
  2. For multiple line comments we have to use / * – – * /
<script type="text/javascript">

//single line comment

/* document.write("Hello"); */

</script>
Enter fullscreen mode Exit fullscreen mode

Check Full Article

Top comments (0)