10 Basic JavaScript Things

Shohelrana Baig
3 min readAug 18, 2020

JavaScript is used for Developing Web Apps, Websites etc.

So I would Counsel to Learn HTML and CSS and know about these thing, Because these are used for Web apps ,Web Designs & Websites etc.

Most Important Things or Topics in JavaScript:

1.Variable

2.If-Else

3.Array

4.Loop

5.Function

6.Object

7.Error Handling

8. Dom

9. API

10. JSON

1. Variable:

In JS programming language, JavaScript variables are containers for storing data values.

In JavaScript, there are 3(three) keywords used to declare a variable. These are Var, Let and Const.

var — variable’s scope is the function it’s inside of. Use ‘var’ to signal untouched legacy code.

let — Use ‘let’ if you have to rebined a variable.

const — The const declaration creates a read-only reference to a value. It doesn’t mean the value it holds is immutable — just that the variable identifier can’t be reassigned. use ‘const’ by default.

2. If-Else:

The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed.

  • Use ‘if’ specify a block of code to be executed, if a specified condition is true.
  • Use ‘else’ specify a block of code to be executed, if the same condition is false.
  • Use ‘else if’ to specify a new condition to test, if the first condition is false.

3. Array:

Collection of data of same-type. JavaScript arrays are used to store multiple values in a single variable.

An array is a special variable, which can hold more than one(1) value at a time.

4. Loop:

JavaScript loops are used to repeatedly run a block of code — until a certain condition is met.

For Loop, while loop , do-while loop

5. Function:

JavaScript functions are used to perform operations. We can call JavaScript function many times to reuse the code.

<script>

function doSome(){

alert(“hello! this is message”);

}

doSome();

</script>

6. Object:

Objects are variables too. But objects can contain many values.

7.Error Handling:

Error handling refers to the routines in a program which responds to abnormal input or conditions. The quality of such routines is based on the clarity of the error messages & the options given to users for resolving the problem.

8. DOM:

DOM ( Document Object Model)

Document Object Model (DOM) is a platform and language-neutral interface which allows programs and scripts to dynamically access and update the content, structure, and style of a document.

9. API:

Application Programming Interfaces (APIs) are constructs made available in programming languages to allow developers to create complex functionality more spontaneously. They abstract more complex code away from you, providing some easier syntax to use in it place.

10. JSON:

JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null . It is based upon JavaScript syntax but it is distinct from it. some JavaScript is not JSON.

--

--