Ans: a. 10
var z = 0;
var i = 0;
do{
z = z+i;
i = i+1;
}while(i < 5);
z = 0 + 1 + 2 + 3 + 4 = 10
Given the following JavaScript code, what will be displayed on the web page? var pho = new Array(); for (var i = 0; i< 7; i++) { pho[i] = (i*i) + 3; } for (var i = 0; i< 7; i++) { document.write(i + " => " + pho[i] + "<br>"); } 1 => 4 2 => 7 3 => 12 4 => 19 5 => 28 6 => 39
Given the following JavaScript code, what will be displayed on the web page? var i, j; for (i=1; i<=3; i++) { for (j=2; j<=5; j++) { document.write(i+ "," + j + "; "); } document.write("<br>"); } 2,3; 3,4; 4,5; 4,6;
Consider the following JavaScript skeletal program: //the main program var x: function sub1 () { var x: function sub2 () { } } function sub3 () { } Assume the execution of this program is in the following unit order: main calls sub1 sub1 calls sub2 sub2 calls sub3 a. Assuming static scoping, which declaration of x is the correct one for a reference to x in: i. sub1 ii. sub2 iii. sub3 b. Repeat part a, but assume dynamic...
Given the following JavaScript code, what will be displayed on the web page? var x = 5; var y = 12; while (x < y) { document.write(x); document.write("<br>"); x=x+3; }
X
and z are independent. Var(x)=1 ; Var(z) = sigma ^2. E(z)= 0 and y=
ax+b+z
I) cov(x,y)= ?
ii) corr(x,y)=?
dependent Varvane 2.
How can I this to jquery instead of it being javascript? function showMssg() { var message = document.getElementsByTagName('pre')[0]; var console = document.getElementById('console'); if (message.style.display == 'block') { log += ' The log is now hidden. '; message.style.display = 'none'; console.innerHTML = 'Show Console Log'; } else { log += ' The log is now visible. '; message.innerHTML = log; message.style.display = 'block'; console.innerHTML = 'Hide Console Log'; } }
I have this module of javascript var data = [ {id: 1, firstName: 'John', lastName: 'Smith'}, {id: 2, firstName: 'Jane', lastName: 'Smith'}, {id: 3, firstName: 'John', lastName: 'Doe'} ]; module.exports.setid = function (value) { data.id = value; }; module.exports.getid = function () { return data.id; }; module.exports.setFirstName = function (value) { data.firstName = value; }; module.exports.getFirstName = function () { return data.firstName; }; module.exports.setLastName = function (value) { data.lastName = value; }; I wrote the following to get all first...
Consider the following program, written in JavaScript-like syntax: // main program var x, y, z; function sub1() { var a, y, z; . . . } function sub2() { var a, b, z; . . . } function sub3() { var a, x, w; . . . } Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during execution of the last subprogram activated? Include with each visible variable the name of the...
how is this solves? function looping(x,y){ for(var i=0; i<x; i++){ for(var j=0; j<x; j++){ console.log(i*j); } } } z = looping(3,3); console.log(z);
How do I figure out the var ??
[Prior Quarter] Var +/- Var % Budget Projection Next Q 64,685 901 100 0 59,685 901 0 0 5,000 0 0% 100 100% I 60,586 [Prior Quarter] 65,586 Budget Projection Next Q Var +/- Var %