JavaScript Basics Tutorial With Example

Total Blog Views: 78

Blog Status: publish

Created By: vishnu Created at: 09-04-2021

Tags: godaddy hosting programming scrape any website data Technology web development java javaScriipt Tutorial server

What is JavaScript?

JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.

Introduction to JavaScript

 

 

You Need Tool

To start with, you need a text editor to write your code and a browser to display the web pages you develop. You can use a text editor of your choice including Notepad++, Visual Studio Code, Sublime Text, Atom or any other text editor you are comfortable with. You can use any web browser including Google Chrome, Firefox, Microsoft Edge, Internet Explorer etc.

 Recommed Tool - Visual Studio Code

 

Hello World Example:

<!DOCTYPE HTML>
<html>
<body>
<p>Before the script...</p>
<script>
alert( 'Hello, world!' );
</script>
<p>...After the script.</p>
</body>
</html>

 

What is Function in JavaScript?

Functions are very important and useful in any programming language as they make the code reusable A function is a block of code which will be executed only if it is called. If you have a few lines of code that needs to be used several times, you can create a function including the repeating lines of code and then call the function wherever you want.

 

 

How to Create a Function in JavaScript

  1. Use the keyword function followed by the name of the function.
  2. After the function name, open and close parentheses.
  3. After parenthesis, open and close curly braces.
  4. Within curly braces, write your lines of code.

Syntax:

 

function functionname()
{
  lines of code to be executed
}

Try You to Solve 


vishnu

I'm doing Collage Study Right Now and Make Blog About information technology & Info. Programming Share my blogs and comment on it Give me more suggestion on it!



Comments



  • shahdabansari | almost 4 years ago
    Good information sir
  • swazahmad | almost 4 years ago
    Vishnu can you please use the codeviewer of default code or just copy paste my code area from any of my blog
Buy traffic for your website

About Shadbox

we have the “Get things executed” lifestyle at our place of work. There are not any excuses, no if’s or however’s in our dictionary. committed to navigating the ship of creativity to create cell answers, we resolve the real-lifestyles troubles of our clients and their clients. Our passion for work has won us many awards, year after 12 months.

Services

Downloads