- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 8862 Articles for Front End Technology
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
138 Views
Object.is()Object.is() is used to check whether two values are same or not. Two values are same when they have the following criteria. Either both the values are undefined or null .Either both are true or false.Both strings should be of same length, same characters and in same order.The polarities of both the values should be equal.Both the values can be NaN and should be equal.syntaxObject.is(val1, val2);It accepts two parameters and scrutinize whether they are equal or not. If equal gives out true as output else false as output.There is a small difference between Object.is() and "==" that is when comparing +0 and -0, the former results false whereas the latter results true. ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
5K+ Views
To add two strings we need a '+' operator to create some space between the strings, but when the first string itself has a space with in it, there is no need to assign space explicitly. In the following example since the string 'str1' has a space with in it, just only concatenation without space is adequate to add both the strings.ExampleLive Demo function str(str1, str2) { return (str1 + str2); } document.write(str("tutorix is the best ", "e-learning platform")); Outputtutorix is the best ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
294 Views
Parsing an URLIt is very simple to parse an URL in javascript by using DOM method rather than Regular expressions. If regular expressions are used then code will be much more complicated. In DOM method just a function call will return the parsed URL. In the following example, initially a function is created and then an anchor tag "a" is created inside it using a DOM method. Later on the provided URL was assigned to the anchor tag using href. Now, when function returns the parts of the URL, it tries to return the parsed parts as shown in the output. ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
10K+ 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 to hexadecimal characters using escape() method. Later on those marks were decoded in to their natural characters using unescape() method. Live Demo // Special character encoded with escape function var str = escape("Tutorialspoint!!"); document.write(""); document.write("Encoded : " + str); // unescape() function document.write("Decoded ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
258 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". So using regular expressions the non-word characters were replaced with nothing('') so as to get the word characters as the output.Live Demo function remNonWord (string) { if ((string===null) || (string==='')) return false; else string = ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
108 Views
weakSet.has()This is an inbuilt function in javascript which is used to return a boolean value on scrutinizing whether an object is present in weakSet or not. The weakSet object lets you store weakly held objects in a collection.SyntaxweakSet.has(obj);ArgumentsFrom the above line of code, weakSet.has() accepts a parameter 'obj' and checks whether the parameter is present in the provided weakSet or not.Returning valueBased on presence of value, whether it is in weakSet or not, the weakSet.has() method returns a boolean output. If the value is present then true will be returned else false will be returned.Example-1In the following example weakSet.has() checks whether the object(user provided) 'object1' is ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
117 Views
The HTML DOM Object type Property is used to set or return the value of the type attribute of an object. However, the type attribute is used to set the media type like the object.Following is the syntax to set the type property −obj.type = type_of_mediaAbove, type_of_media is the standard media type, for example, image/bmp, image/tiff, image/tff, etc.Following is the syntax to return the type property −obj.typeLet us now see an example to implement the DOM Object type property −Example Live Demo Display the media type function display() { var x = document.getElementById("obj").type; ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
822 Views
Videos can be easily from YouTube to your web page. You need to just embed the videos. At first, get the Video id − Step1: Go to the Video and right click on it. Select “Stats for nerds” − On clicking, you will get the following dialog box displaying the stats − Above you can see the video id is F6m0ghjadlw. Now, we will embed the same video using its id − Example Learn WordPress WordPress Installation Following is the video demonstrating how to install WordPress on localhost ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
106 Views
Whenever you create an HTML document, the doctype is the first thing placed in the document.It conveys the web browser about the version of the HTML, this page is written on. It is not casesensitive.Let us see an example displaying DOCTYPE on the top −Example Live Demo Document Title comes here Demo Heading This is the demo text. OutputNow let us see some of the declarations for doctype −HTML5 DeclarationExampleHTML 4 StrictThis document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents.HTML 4 ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
115 Views
The HTML DOM Anchor hash property is used to set or return the anchor part of the href attribute value. The part of the URL after the # is what we call the anchor part of a link.Following is the syntax to set the hash property −anchorObject.hash = anchor_partAbove, anchor_part is the anchor part of the URL.Following is the syntax to return the hash property −anchorObject.hashLet us now see an example to implement the DOM Anchor hash property −Example Live Demo Company Our Team Get the anchor part... Display Anchor Part function display() { ... Read More