Prelim CSS
Prelim CSS
let result;
switch (operator) {
case '+':
break;
case '-':
break;
case '*':
break;
case '/':
if (num2 !== 0) {
} else {
break;
default:
}
Write a javascript program to check whether entered number is prime or not.
function isPrime(num) {
if (num < 2) {
if (num % i === 0) {
Write a JavaScript program that will display current date in DD/MM/YYYY format.
function getCurrentDate() {
return formattedDate;
}
2]
3]
Write a JavaScript function that checks whether a passed string is palindrome or not.
function check_palindrome(str) {
let j = str.length - 1;
if (x != y) {
return false;
return true;
Write JS code to perform following operation on string using split( ) Input String: “Sudha Narayan
Murthy” Display output as: First Name: Sudha Middle Name: Narayan Last Name: Murthy
// Input string
4]
List ways of protecting your web page and describe any one of them.
3) Hiding JavaScript
The source code for your web page—including your JavaScript—is stored in the cache, the part of
computer memory where the browser stores web pages that were requested by the visitor. A
sophisticated visitor can access the cache and thereby gain access to the web page source code.
However, you can place obstacles in the way of a potential peeker. First, you can disable use of the
right mouse button on your site so the visitor can't access the View Source menu option on the
context menu. This hides both your HTML code and your JavaScript from the visitor. Nevertheless,
the visitor can still use the View menu's Source option to display your source code. In addition, you
can store your JavaScript on your web server instead of building it into your web page. The browser
calls the JavaScript from the web server when it is needed by your web page. Using this method, the
JavaScript isn't visible to the visitor, even if the visitor views the source code for the web page.
5]
6]