Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
205 views
in Enterprise Resource Planning by (30.5k points)
closed by

Write the syntax of a built in function in JavaScript.

1 Answer

+1 vote
by (30.4k points)
selected by
 
Best answer

Built in functions(methods) 

1. alert(): 

This is used to display a message(dialogue box) on the screen. 

eg: alert(“Welcome to JS”); 

2. isNaN(): 

To check whether the given value is a number or not. It returns a Boolean value. If the value is not a number(NaN) then this function returns a true value otherwise it returns a false value. 

Eg:

  • isNaN(“BVM”); returns true 
  • isNaN(8172); returns false 
  • isNaN(“680121”); returns false 
  • alert(isNaN(8172); displays a message box as false. 

3. toUpperCase(): This is used to convert the text to uppercase. 

Eg: var x=“bvm”; 

alert(x.toUpperCase());

Output is as follows

4. to Lower Case(): This is used to convert the text to lower case. 

Eg: var x=“BVM”; 

alert(x.toLowerCase());

Output is as follows

5. charAt(): It returns the character at a particular position. 

Syntax: variable.charAt(index); 

The index of first character is 0 and the second is 1 and so on.

Eg: 

var x=”HIGHER SECONDARY”; alert(x.charAt(4));

Output is as follows

Eg 2. 

var x=”HIGHER SECONDARY”; 

alert(“The characters @ first position is “+ x.charAt(0));

6. length property: It returns the number of characters in a string.

Syntax: variable.length; 

Eg. 

var x=”HIGHER SECONDARY”; 

alert(“The number of characters is “+ x.length); 

Output is as follows(note that space is a character)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...