/    Sign up×
Community /Pin to ProfileBookmark

Question on some javascript function…pls help

[B]1. When does div.setAttribute(”###”) not equal div.###?[/B]

[B]2. What’s the difference between these two statements:[/B]

a. var x = 3;
b. x = 3;

[B]3. What’s the difference between:[/B]

a. !!(obj1 && obj2)
b. (obj1 && obj2)

[B]4. Write a one-line piece of JavaScript code that concatenates all strings passed into a function:[/B]

function concatenate(/*any number of strings*/) {

var string = /*your one line here*/
return string;
}

[B]5. What do these two examples have in common?[/B]

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!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyMar 23.2007 — We're not going to do your homework for you.
Copy linkTweet thisAlerts:
@kmthienauthorMar 23.2007 — sorry !
×

Success!

Help @kmthien spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...