Vineeth.mariserla has Published 117 Articles

How to check whether a key exist in JavaScript object or not?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

217 Views

There are a couple of ways to find whether a key exist in javascript object or not.Let's say we have an 'employee' object as shown below.   var employee = {       name: "Ranjan",       age: 25    }Now we need to check whether 'name' property exist ... Read More

How to access a function property as a method in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

791 Views

Accessing a function as a method A javascript object is made up of properties. To access a property as a method, just define a function to a property and include other properties in that function.In the following example an object called "employee" is created with properties "fullName", "lastName" , "firstName" and ... Read More

How to hide e-mail address from an unauthorized user in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

977 Views

Hiding an e-mail addressThe following steps are to be followed to hide our e-mail from unauthorized users. In every email address '@' symbol is common so try to remove it from the email address using split() method. In the following example after splitting the email(batman@gmail.com) we get the result as batman, gmail.com.Divide ... Read More

How to check if a variable is an array in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

4K+ Views

In javascript we can check whether a variable is array or not by using three methods.1) isArray() methodThe Array.isArray() method checks whether the passed variable is array or not. If the variable is an array it displays true else displays false.SyntaxArray.isArray(variableName)ExampleLive Demo arr = [1, ... Read More

What is the use of Map in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

162 Views

MapMap holds key value pairs and remembers the actual insertion order of the keys. Map allows to store only a unique value.syntaxnew Map([iterable])Case-1: Absence Of MapIn the absence of Map, since javascript object endorses only one key object, If we provide multiple keys only the last one will be remembered. ... Read More

How to remove non-word characters in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

226 Views

Removing non-word charactersTo remove non-word characters we need to use regular expressions. The logic behind removing non-word characters is that just replace the non-word characters with nothing('').ExampleIn the following example there are many non-word characters and in between them there exists a text named "Tutorix is the best e-learning platform". ... Read More

How to decode an encoded string in JavaScript?

vineeth.mariserla

vineeth.mariserla

Updated on 30-Jul-2019 22:30:26

9K+ Views

DecodingIn JavaScript, to decode a string unescape() method is used. This method takes a string, which is encoded by escape() method, and decodes it. The hexadecimal characters in a string will be replaced by the actual characters they represent using unescape() method.Syntaxunescape(string)ExampleIn the following the two exclamation marks have converted ... Read More

Advertisements