Exam Questions and CORRECT Answers
z-index property? - CORRECT ANSWER - the order of pages, (layers)
how do you access the arguments without using the parameters names? - CORRECT
ANSWER - function Add(x,y,z){
args[1]
}
.describe the difference between a cookie, sessionstorage, and localstorage: - CORRECT
ANSWER - cookie:key value pair
localstorage: maintain state with it (close browser and still there)
sessionStorage: as long as you're connected
.describe the difference between <script>, <script async>, and <script defer>? - CORRECT
ANSWER - execute as soon as its avaailable (script async)
execute when the page is fininished parsing (script defer)
what are cookies? and what are they good for? - CORRECT ANSWER - hold data(limit is
2mb?), good for to pass from page to page
as a dev, where can u find the cookies you have per site/url? - CORRECT ANSWER -
browser, inspect
how does your browser manage cookies across all the sites you visit? - CORRECT
ANSWER - each cookie has a domain key
what are http headers? - CORRECT ANSWER - request & response
,what are breakpoints? - CORRECT ANSWER - debugging tool
what does a 404 response code mean? - CORRECT ANSWER - not found
what does a 500 response code mean? - CORRECT ANSWER - internal server
how would you give all instances of a JS "person" object a new property? - CORRECT
ANSWER - add it to the original assignment
console.log(0.1 + 0.2 == 0.3)? - CORRECT ANSWER - //answer: false, because javascript
cannot take in decimals!.... instead use:
parseFloat(0.2,1) + parseFloat(0.3,1) = 0.3
The Impressive For Loop - CORRECT ANSWER - for
var array = [x,x];
(var i= 0; var a = array.length; i <a; i++)
what is a named function in JS? - CORRECT ANSWER - an anonymous function
how do you exit a loop before its normal loop cycle completes? - CORRECT ANSWER -
break, return,
can a function call itself? - CORRECT ANSWER - yes
whats the difference between POST and GET? - CORRECT ANSWER - POST-adding info ,
GET- just getting the info, going to a URL, not sending anything
, what is responsive design? what are the pros and cons? - CORRECT ANSWER - bootstrap,
alignment might be off and pain in teh ass
what are arrays? - CORRECT ANSWER - collection of elements
how would you declare an array in JS? - CORRECT ANSWER - var mp = [ ];
whats the difference between == and === ? - CORRECT ANSWER - === has to be exactly
the same
what are closures? - CORRECT ANSWER - whatevers encapsulated within the function
closure
difference between function declaration and function expression? - CORRECT ANSWER -
expression is the (var mp = {};), declaration is just function Add(){}
declarations can be hoisted
call ,apply and bind methods? - CORRECT ANSWER - .bind is used when you want that
function to be called later
.call and apply() when you want to invoke the function immediately
write the function that outputs the Fibonacci numbers: - CORRECT ANSWER - var i;
var fib = []; // Initialize array!
fib[0] = 0;
fib[1] = 1;
for(i=2; i<=10; i++)
{
// Next fibonacci number = previous + one before previous