What is Javascript?

Moniur Rahman Shimul
2 min readMay 5, 2021
Javascript is a Lightweight, interpreted, or compiled Programming Language.

JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.

Although Javascript was initially used only to work on server sites, it is now being used in all cases. Although Javascript was not very popular in the beginning, now it has grown to such an extent that Javascript is at the top of all programming languages.
There are several versions of Javascript, one of which is Es6, which is widely used.

String

The String an object is used to represent and manipulate a sequence of characters.

One of the modern Javascript is String. Why not write any object, first we have to write through String.

Sting Method………..

  1. Sting.prototype.concat();

A string is concatenated using two variables. some example explain is.

const str1 = ‘Hello’;
const str2 = ‘World’;

console.log(str1.concat(‘ ‘, str2));
// expected output: “Hello World”

2. Sting.prototype.replace();

The replacement method is to specify the string that you want to change and replace it with the string that you want to replace. some example explain is.

const p = ‘ Moniur Rahman Shimul’;

console.log(p.replaceAll(‘Rahman’, ‘Rahim’));

3.String.prototype.trim();

The function of string.prototype.trim is to use the trim method to delete any empty space before a string. Some Examples explain it.

const code explain = ‘ Hello world! ‘;

console.log(code explain);

Number..

Javascript number type Single-precision and double-precision value.With javascript number we solve all kinds of mathematical, logical work, without number system all kinds of programming work can not be solved, that is, logical, mathematical work can never be done, so the numbering system in programming is very

numbering method

  1. number.prototype.parseInt();

The Number.parseInt() method parses a string argument and returns an integer value.

function roughScale(x, base) {
const parsed = Number.parseInt(x, base);
if (Number.isNaN(parsed)) {
return 0;
}
return parsed * 100;
}

console.log(roughScale(‘321’, 2));
// expected output: 0

Math

Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object. All kinds of mathematical work are usually done through math.

  1. Math.ceil();

The Math.ceil() function always rounds a number up to the next largest integer. Code Example..

console.log(Math.ceil(.95));
// output: 1

2. Math.florr();

The Math.floor() function returns the largest integer less than or equal to a given number.

console.log(Math.floor(5.95));
// expected output: 5

--

--