Basic Javascript

Joyonto Karmakar
Javascript on Your Fingertips
2 min readMay 5, 2021

Hello Everyone!! This is a blog, Where I discuss about basic javascript. This blog will help you to start your developing career with javascript very easily.

Javascript on your hand banner

What is Javascript and Why We Use It?

Javascript is a scripting language. By using javascript we can implement many complex features on our website. It supports functional programming. It gives an interactive look to the website. We can create dynamic content on our website by using javascript. Today we will discuss some javascript features in this blog.

Let’s start with javascript concepts:

Data Types

Data Type is an important concept for every programming language. JavaScripts have many types of data types. There are Number, String, Boolean, Null, Undefined.

In this blog, now we will discuss String Data Type.

String Data Type

A String data type is a text variable. It is surrounded by quotations. We can use Quotation for a string data type in 3 ways:

const string1 = "String with Double Quotation";
const string2 = 'String with Single Quptation';
const string3 = `String with Back Ticks`;

Number Data Type

We will not use any type of quotation while we use the Number data type. Just we will put the straight number. We can use both Integer and floating types of numbers.

let num1 = 123546;
let num2 = 2530.456;

Array

The array is a special type of variable, that can hold the same type of data in a single array at a time. In JavaScript, arrays are used to store multiple values in a single variable. For example, If you have a list of items you store these in an array like this:

let car= ['Toyota', 'Honda', 'Suzuki']

Then If you want to know how many cars is on your list in javascript you have to use

console.log(car.length)

Your output result will

3

Math

Math is a built-in static object in javascript. This object is allowed to perform mathematical operations.

we can do ceil, floor, sqrt, round, min, max operations by using Math object.

Math.ceil()

This operation returns the nearest rounded-up integer.

for example,

Math.ceil(4.9)

the answer will

5

Math.floor()

This operation returns the nearest rounded-down integer.

for example,

Math.floor(4.9)

the answer will

4

Math.round()

This operation returns the nearest rounded integer.

for example,

Math.round(4.9)

the answer will

5

Math.sqrt()

This operation returns the square root of the integer.

for example,

Math.sqrt(9)

the answer will

3

follow me on linkedin,

visit my github profile,

visit my portfolio website

--

--

Joyonto Karmakar
Javascript on Your Fingertips

I'm a Frontend Web Developer with 3 Years of Experience. I'm developing user experiences with HTML, CSS, JavaScript. Explore my portfolio for more web projects.