Explain bitwise operators available in JavaScript
Explain bitwise operators available in JavaScript
object.
6. Explain Object creation in JavaScript using ‘new’ keyword with adding properties and
7. Write a JavaScript for loop that will iterate from 1 to 15. For each iteration it will check if the
current number is obb or even and display a message to the screen Sample Output: “1 is
13. Write a JavaScript program to validate user accounts for multiple set of user ID and
<body>
<br><br>
<br><br>
<br><br>
<p id="display"></p>
<script>
function check() {
switch(uid){
case "darshan.khapekar@vpt.edu.in":
if(pass == "darshan@123"){
break;
case "prashant.yelurkar@vpt.edu.in":
if(pass == "prashant@123"){
break;
case "konisha.thakare@vpt.edu.in":
if(pass == "konisha@123"){
break;
default:
a) charCodeAt()
b) fromCharCode()
22. Differentiate between push() and join() method of array object with respect to
string : Sudha Narayana Murthy” Display output as First Name:Sudha Middle Name:
24. Explain splice() method of array object with syntax and example.
25. Write a program using sort method of array object.
26. Write a JavaScript program that will display current date in DD/MM/YYYY format.
</head>
<body>
<script>
var currentDate=d.getDate()+'/'+(d.getMonth()+1)+'/'+d.getFullYear()
document.write(currentDate)
</script>
</body>
</html>
27. Write a JavaScript program that will remove the duplicate element from an Array.
<script>
let arr = ["scale", "happy", "strength", "peace", "happy", "happy"];
function removeDuplicates(arr) {
let unique = [];
for(var i of arr) {
if(uniqueArr.indexOf(i) === -1)
{
uniqueArr.push(i);
}
}
document.write(uniqueArr);
}
document.write(removeDuplicates(arr));
</script>
</body>
</html>
28. Write a JavaScript program that will display list of student in ascending order according to
<script>
var Avgmarks = 0;
Avgmarks += students[i][1];
a = students[i];
students[i] = students[j];
students[j] = a
document.write("<br><br>");
document.write(students[i]+"<br>")
</script>
29. Write and explain a string functions for converting string to number and number to string.
30. Differentiate between concat( ) & join( ) methods of array object.
31. Write a JavaScript function to check the first character of a string is uppercase or not.
<script>
function upper_case(str)
{
regexp = /^[A-Z]/;
if (regexp.test(str))
{
document.write("String's first character is uppercase");
}
else
{
document.write("String's first character is not uppercase");
}
}
upper_case('Abcd');
</script>
32. Write a JavaScript function to merge two array & removes all duplicate values.
function mergearr(arr1, arr2)
{
// merge two arrays
var arr = arr1.concat(arr2);
var uniqueArr = [];
// loop through array
for(var i of arr) {
if(uniqueArr.indexOf(i) === -1)
{
uniqueArr.push(i);
}
}
document.write(uniqueArr);
}
var array1 = [1, 2, 3,6,8];
var array2 = [2, 3, 5,56,78,3]
mergearr(array1, array2);
33. Write a javascript function that accepts a string as a parameter and find the length of the
string.
function len(text)
return (text.length);
34. Develop javascript to convert the given character to unicode and vice-versa.
var x="HELLO";
document.writeln("<br>"+x.charCodeAt(4));
document.write(res);
</script>
35. Write a javascript function to generate Fibonacci series till user defined limit.
function fibonacci(num)
var x = 0;
var y = 1;
var z;
var i = 0;
document.write(x);
document.write("<br>"+y);
{
z = x + y;
x = y;
y = z;
document.write("<br>"+y);
answer = fibonacci(num);
</script>
var a=0;
var b=1;
for(var i=1;i<=num;i++)
document.write(a+" ");
var c=a+b;
a=b;
b=c;
36. Write a Java Script code to display 5 elements of array in sorted order.
37. Define objects and write different ways to create an Object with example.
39. Write JavaScript that initializes an array called Colors with the names of 3 Colors and
40. Write HTML code to design a form that display two textboxes for accepting two
numbers,one textbox for accepting result and two buttons as ADDITION and
SUBTRACTION.Write proper JavaScript such that when the user clicks on any one of the
button,respective operation will be performed on two numbers and result will be displayed
in result textbox.