Vineeth.mariserla has Published 278 Answers

How to concatenate two strings so that the second string must concatenate at the end of first string in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:32:24

To concatenate we have string.concat() method. But it will not provide any specificity, which means the length of the string after concatenation, the specific values that have to be added, etc. So to reduce this problem javascript has provided string.padEnd() method. This method takes two parameters. One is the length ... Read More

What is the importance of str.padStart() method in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:31:18

We can attach two strings using the concat() method. But if we need to attach a specific string at the starting of the first string then the easiest way is string.padStart(). This method not only adds the second string at the start of the first string but also looks after the ... Read More

How to loop through arrays in JavaScript objects?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:26:02

Looping through arrays inside objects is the same as looping through objects. We have to use 'for...in' loop to loop through arrays inside objects.ExampleIn the following example, an object "obj" is defined. This object has an array in it. Using 'for...in' loop, the elements in that array are displayed as ... Read More

How to get the Width and Height of the screen in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:23:14

Javascript has provided window.screen object that contains information regarding the user's screen. The information includes height and width, and also many other features. To find the height and width of the screen the methods provided by javascript are screen.height and screen.width respectively.Height-syntaxscree.height;Width-syntaxscree.width;ExampleIn the following example, the width of the screen is ... Read More

How to find whether a provided number is safe integer or not in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:19:33

Javascript has some limitations regarding numbers. Any number should be in a standardized computer network format. If any integer violates this rule, it can't be a safe integer. The safe integers consist of all integers from -(2^53 - 1) inclusive to (2^53 - 1) inclusive (± 9007199254740991 or ± 9, 007, 199, 254, ... Read More

What is the importance of Navigator Object in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:12:38

Navigator objectNavigator Object has a lot of uses in javascript. This object is used to find the location we needed, whether the browser is in online mode or not, whether Java is enabled or not in our system, etc. Let's discuss some of its uses.Example-1In the following example, the navigator object ... Read More

How to invoke a function with a function constructor in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:11:57

We can invoke a function in 3 ways. The first one is as a function, the second one is as a method and the third one is as a function constructor. But in all the three, invoking a function with a function constructor is a peculiar one because this method uses inheritance ... Read More

What is the use of parsing dates in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:10:17

Parsing a date will give us the time in milliseconds. Date.parse() is used to parse a date. This method actually returns a number of milliseconds between the provided date and January 1, 1970. It is programmed in that way by the developers to get time in milliseconds from January 1, 1970 to ... Read More

How to compare dates in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:08:55

Dates can be compared easily in javascript. The dates can belong to any frame i.e past, present and future. Past dates can be compared to future or future dates can be compared to the present. Example-1In the following example, a date in the year 2000 is compared with today's date and ... Read More

How to remove the last digit of a number and execute the remaining digits in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jun-2020 15:02:01

Before the introduction of Bitwise operators, a number is first converted into a string and later on, using string methods, some part of that number is sliced and the remaining part is executed. Here type-conversion i.e a number into a string is necessary. But the introduction of Bitwise or has ... Read More

Advertisements