Nitya Raut has Published 276 Articles

How to return a string from a JavaScript function?

Nitya Raut

Nitya Raut

Updated on 19-Jun-2020 11:43:44

14K+ Views

To return a string from a JavaScript function, use the return statement in JavaScript.ExampleYou need to run the following code to learn how to return a string using return statement −                    function concatenate(name, subject) {             ... Read More

How to create JavaScript Date object from date string?

Nitya Raut

Nitya Raut

Updated on 18-Jun-2020 12:13:04

181 Views

To create a date object from date string, just add the string like this −var date = new Date(2018, 1, 1);ExampleYou can try to run the following code to create date object from date string. Here, the month is indexed as 0 for Jan, 1 for Feb, etc in JavaScript ... Read More

Websites every Java developer should bookmark

Nitya Raut

Nitya Raut

Updated on 17-Jun-2020 13:48:37

91 Views

There are many sites which are a good resource to learn java. Following is the list of most popular websites.Tutorialspoint - www.tutorialspoint.comStackOverflow - www.stackoverflow.comDZone - www.dzone.comWikipedia - www.wikipedia.orgIBM Developer Works - www.ibm.com/developerworks/java/TechGig - www.techgig.comGitHub - www.github.comJava documentation - docs.oracle.com/javase/Coursera - www.coursera.org/JavaWorld - www.javaworld.com/Read More

How to use the 'with' keyword in JavaScript?

Nitya Raut

Nitya Raut

Updated on 17-Jun-2020 06:14:29

5K+ Views

The with keyword is used as a kind of shorthand for referencing an object's properties or methods.The object specified as an argument to with becomes the default object for the duration of the block that follows. The properties and methods for the object can be used without naming the object.SyntaxThe ... Read More

How I can change alert message text color using JavaScript?

Nitya Raut

Nitya Raut

Updated on 16-Jun-2020 13:24:05

2K+ Views

You can try to run the following code to change the alert message text color. To change the text color of the alert message, use the following custom alert box. We’re using JavaScript library, jQuery to achieve this and will change the alert message text color to “#FCD116” −ExampleLive Demo ... Read More

How to use JavaScript to set cookies for multiple pages?

Nitya Raut

Nitya Raut

Updated on 16-Jun-2020 11:57:22

946 Views

To set cookies for multiple pages, you need to set the path as −;path=/ExampleThe above will make your cookies to site cookie. You can try to run the following code to set cookies for multiple pages −Live Demo                                                  Enter name:                    

What are the best practices for function overloading in JavaScript?

Nitya Raut

Nitya Raut

Updated on 16-Jun-2020 11:42:02

164 Views

Function overloading occurs when a function performs different tasks based on a number of arguments passed to it.The best practice for function overloading with parameters is to not check the types. The code runs slower when the type is checked and it should be avoided. For this, the last parameter ... Read More

Media object in Bootstrap

Nitya Raut

Nitya Raut

Updated on 15-Jun-2020 07:09:39

100 Views

Use the .media-object class in Bootstrap to set the media object −ExampleLive Demo           Bootstrap Example                                          Lolcode Tutorial                                                                              Introduction                LOLCODE is an esoteric programming language inspired by the funny things on the Internet. It is designed to test the boundaries of programming language design.                                

Bootstrap alert-danger class

Nitya Raut

Nitya Raut

Updated on 15-Jun-2020 07:07:08

259 Views

The alert-danger class in Bootstrap is used to set danger action.You can try to run the following code to implement the alert-danger class in Bootstrap −ExampleLive Demo           Bootstrap Example                                 This is danger action!    

What is 'void' Operator in JavaScript?

Nitya Raut

Nitya Raut

Updated on 13-Jun-2020 13:15:35

185 Views

The void is an important keyword in JavaScript, which can be used as a unary operator that appears before its single operand, which may be of any type. This operator specifies an expression to be evaluated without returning a value.SyntaxThe syntax of void can be either of the following two − ... Read More

Previous 1 ... 4 5 6 7 8 ... 28 Next
Advertisements