Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1.

Write a function validating the Name and Salary such that name field
should accpets only alphabets and Salary field should accepts
numerics.
2. Write a JavaScript function to check whether an `input` is a string or
not.
3. Write a JavaScript function to extract a specified number of characters
from a string.
4. Write a JavaScript program to find the most frequent item of an array.
Sample array : var arr1=[3, 'a', 'a', 'a', 2, 3, 'a', 3, 'a', 2, 4, 9, 3];
Sample Output : a ( 5 times )
5. Write a JavaScript program to add items in an blank array and display
the items.
6. Write a JavaScript function to find the first not repeated character.
7. Find the biggest element in the array of numbers by using Math.max
8. Write a JavaScript function to convert a decimal number to binary,
hexadecimal or octal number.
9. Write a pattern that matches e-mail addresses.
10. Write a JavaScript program to list the properties of a JavaScript
object.
Sample object:
var student = {
name : "David Rayy",
sclass : "VI",
rollno : 12 };
Sample Output: name,sclass,rollno
11. Write a JavaScript program to display the reading status (i.e.
display book name, author name and reading status) of the following
books

var library = [
{
author: 'Bill Gates', title: 'The Road Ahead', readingStatus: true
},
{
author: 'Steve Jobs', title: 'Walter Isaacson', readingStatus: true
},
{
author: 'Suzanne Collins', title: 'Mockingjay: The Final Book of The
Hunger Games',
readingStatus: false
}];
O/P: "Already read 'Bill Gates' by The Road Ahead."
"Already read 'Steve Jobs' by Walter Isaacson."
"You still need to read 'Mockingjay: The Final Book of The Hunger
Games' by Suzanne Collins."

You might also like