Learn JavaScript: Basics of JavaScript Language by Vanamala Srinivas

Learn JavaScript: Basics of JavaScript Language by Vanamala Srinivas

Author:Vanamala, Srinivas [Vanamala, Srinivas]
Language: eng
Format: epub
Published: 2020-03-19T16:00:00+00:00


Live Preview

Exercise 2

Download the Exercise 2

Exercise 2: Ask user to enter a value between 1 to 10 and confirm it is correct or wrong.

Print “CORRECT” or “WRONG” based on the condition met.

Live Preview

3.5 String Operations

Usage of String Operations

There two string operators that can be used to join the string:

+

+=

+ is the string operator that can be used anywhere to join two strings.

Examples:

var name = “Firstname” + “lastname”;

var name += “!”; //Add the value at the last.

String Methods:

indexOf(search, position)

substr(start, length)

substr(start, stop)

toLowerCase()

toUpperCase()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.