Skip to main content

Command Palette

Search for a command to run...

Still Thinking To learn JavaScript ?? Start With Me Now

Updated
โ€ข3 min read
Still Thinking To learn JavaScript ?? Start With Me Now
A

I'm a Community taught developer

Introduction

What is JavaScript?

JavaScript is an object-oriented scripting language used to make webpage interactive.

You must be thinking ๐Ÿค” about what object-oriented or scripting means. okay so let's understand โœจ

Object-oriented programming: It is a programming paradigm ( an approach to solve a problem with the help of some programming languages ) based on the concept of "objects", which can contain data and code: data in the form of fields ( as attributes or properties), and code, in the form of procedures ( as methods).

Scripting Language is basically a language where instructions are written for a run-time environment. They are usually interpreted at run time rather the compiled.

History of javaScript

Before 1995, web pages could only be static, it lacks the capability for dynamic behaviour often the pages were loaded in the browser. There was a demand in the fast-growing web development field to remove these limitations. So in 1995 Brenda Eich

Brendan_Eich.jpg was hired to come up with a new language with syntax similar to java. The new language and interpreted implementation were called LiveScript but shortly changed to JavaScript in December 1995.

Many of you might be thinking why it is called "JavaScript" when it is not at all similar to Java

I also thought the same when heard for the first time. The reason is simple that Java was the hot new programming language at that time and they thought it would create a good impact on the newly invented language.

Now Let's dive into the topic .

Datatypes

Datatype is a category of data representing in distinct way to differentiate between each other. It is divided into two :

  1. Primitive datatype : It includes
    • Numbers ( Integers , Floats )
    • Strings ( Any data under single quote , double quote , or backtick quote )
    • Booleans ( True or False value )
    • Null ( Empty or no value )
    • Undefined ( A declared variable without a value )
  1. Non-primitive datatype : It includes

    • Objects
    • Functions
    • Arrays

Let's Understand with the help of examples

Examples of primitive datatype

 var length = 16;                        // number
 var firstName = "Aditi";              // string
 console.log( 4> 2 );                   // boolean 
 var x = null;
  x;                                    // null 
  var num ;                             // undefined

Examples of non-primitive datatype


let obj1 = {                       // object
name:'Aditi',
role:'Student',
country:'India'
} 

function a(){                      // function

}

var arr = [ 1 , 2 , 3 , 4 , 5 ];    // array

Time For The Test : check the data type of a certain variable

let firstName = 'Sumit';     
let lastName = 'Kumar';       
let country = 'India';    
let city = 'Patna';         
let age = 20;                 
let job;

Congratulations ๐ŸŽ‰๐ŸŽ‰You Have Started Your Journey with one of the most demanding languages JavaScript.

Here are some resources which you can follow

  1. https://codedamn.com/learn/javascript-basics
  2. https://www.w3schools.com/js/default.asp
  3. https://developer.mozilla.org/en-US/docs/Web/JavaScript
  4. https://javascript.info/

This is my first blog so there may be something which you may like or you may not so please write it down in the comment. It'll Sure be going to help me in improving. Thank You

D

Im new to web development..read below question careful .. Thanks for taking time to read ...

We can easily learn html and css coz we can have hands on experience like changing button and changing background color, so our learning becomes easy and this JavaScript is used to make website interactive like switching to next page , liking content etc etc but what does these data types do or other things do coz we need to understand ryt and you have given examples of some name like var = "Aditi" , where are these used in ?? Understood my question ?? I'm a newbie and none are answer this question in a proper way .. coz I can't muggup everything I learn ... I need understand before learning anything.

1
A
Aman Jha5y ago

Well, Js is used to make your website more dynamic and functional. var x= "Aditi" that you quoted is similar to declaring variables in any other programming language. When relating this with HTML and CSS, whenever the user gives an input, be it a click or submitting value inside text box, you need to store the input first before performing a function on it, right? Here Js variables come into effect. These variables can store input from user or you can initialise variables on your own as well. Initialising is just for convenience sake. Suppose you have to use "Vineeth" many times in you code. Then instead of writing it many times we can just declare var a= "Vineeth" and then use a instead.

Example:- Input:- making an online calculator; You need to take input from user and then return the result after performing the calculation.

1