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?

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.

Today almost all websites are using it as web technology, mind is that there is maximum scope in JavaScript in the coming time, so if you want to become a programmer, then you can be very beneficial to learn JavaScript.

What do max people think about Java and JavaScript?

Many people think that Java and JavaScript are the same languages, but both of them are completely different from each other. Due to their similar name, the mind has got a doubt in the people, but let me tell you, both Java and JavaScript are completely different, it was named the same because Java was a very popular language at that time, due to which its name also matches. and today JavaScript has become an independent language.

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>

JavaScript Hello World Program

In JavaScript, ‘document.write‘ is used to represent a string on a browser.

<script type="text/javascript">
	document.write("Hello World!");
</script>

How to comment JavaScript code?

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

//single line comment

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

</script>

What are the uses of JavaScript?

JavaScript is used to perform the following types of tasks

  • Cookies: Some information can be stored in the browser with JavaScript and when the user visits again, they can access it, this information is called cookies.
  • Autocomplete: By Autocomplete, it means that when we type something in the text box, suggestions start coming down. This is called Autocomplete. We can create this type of task in JavaScript.
  • With JavaScript, we can find out which browser the user is using.
  • Animation: With JavaScript, we can make our website very attractive by adding animation to our website.
  • Slider: Using JavaScript we can create an Image Slider, carousel for our website.
  • Form Validation: Form validation means that when a form is filled by a user, at that time to verify whether the entered data is in the correct format such as email, phone no. Etc. This process is called form validation.

With JavaScript, we can do many more tasks that make our website even more attractive, so that we can make our website beautiful.

What tools are required to use JavaScript?

We do not need any special tool to run the code of JavaScript, for this we need only two things.

  • Code Editor: For coding in JavaScript we can use these text editor like Notepad ++, Dreamweaver, Sublime, Visual Code Studio, etc. However we can also use a normal text editor but if we use a specific code editor when used, it helps us a lot in coding.
  • Web Browser: We need a web browser to display JavaScript code.

Advantages of JavaScript

  • Easy to Learn: JavaScript is very simple and it is very easy to learn. Its code syntax is very simple.
  • Fast Execution: JavaScript is very fast because it runs on the client-side, so there is no need for such server interaction.
  • Cross-Platform: Supports JavaScript Cross-Platform It can easily work in any operating system and any web browser like Chrome, Firefox, Microsoft EDGE, etc.
  • Event-Based Code: With JavaScript, we can create a function that executes when a particular event like button click, mouse move, etc. happens.
  • Popularity: The popularity of JavaScript has increased so much that JavaScript is being used everywhere on the web.

Disadvantages of JavaScript

  • Security: As we all know that JavaScript would execute on the browser, so it is not very secure, however keeping security in mind, some restrictions are placed inside JavaScript such as cannot read or write the files of the user’s system. Despite these restrictions, some malicious codes can still run, so people like to disable JavaScript.
  • Browser Support: JavaScript is sometimes interpreted differently by different browsers. This makes it a bit difficult to write cross-browser code.

We hope you liked this article (What is JavaScript). You should definitely keep your thoughts about it in the comment below and share this article with your friends.

Leave a Comment