[B]1. When does div.setAttribute(”###”) not equal div.###?
[B]2. What’s the difference between these two statements:
a. var x = 3;
b. x = 3;
[B]3. What’s the difference between:
a. !!(obj1 && obj2)
b. (obj1 && obj2)
[B]4. Write a one-line piece of JavaScript code that concatenates all strings passed into a function:
function concatenate(/*any number of strings*/) {
var string = /*your one line here*/
return string;
}
[B]5. What do these two examples have in common?
Example 1:
var obj = document.getElementById(’adiv’);
document.getElementById(’adiv’).ptr = obj;
Example 2:
function assignClick() {
var el = document.createElement(’div’);
function handleClick() {
el.innerHTML = ‘clicked!’;
}
el.attachEvent(”onclick”, handleClick);
}
pls help, thanks !
regards,
Cut carbon emmision!