Introduction to JavaScript

TumpaDey
Nov 3, 2020

JavaScript: JavaScript is the programming language of HTML & the web. JavaScript is easy to learn.

Study of JavaScript: JavaScript is one of the 3 languages all web developers must learn: 1.HTML to define the content of web pages. 2.CSS to specify the layout of web pages. 3.JavaScript to program the behaviour of web pages.

Variable in JavaScript: JavaScript includes variables and it can be changed anytime. A variable must have a unique name.

Types of Variable: JavaScript work to three data types.

Numbers — 123,120,589 etc

String — of text e.g “The types of values”

Boolean — true or false

JavaScript String: The toString() method returns a string representing the object.

const o = new Object();
o.toString(); // returns [object Object]

JavaScript Number: The Number() function converts the object argument to a number that represents the object’s value.

Number('123')  // returns the number 123
Number('123') === 123 // true

Number("unicorn") // NaN
Number(undefined) // NaN

JavaScript Array: JavaScript ,array is a single variable that is used to store different elements.

Var friendsAge =[15,17,14,16];
var sonaliAge = friendsAge[21];
console.log(sonaliAge)

JavaScript Math: Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object. Math works with the Number type.

Math.round: The Math.round() function in JavaScript is used to round a number to its nearest integer.

Math.floor: JavaScript.floor() function that is used to return the largest integer value that i less or equal to a number.

Math.random: The random() method returns a random number from 0 up to but mot including 1.

--

--

TumpaDey
0 Followers

I have keen interest in learning programing and coding is my passion. I want to be a skilled web developer so that I can share my ideas and thought by creating