Thursday, 10 December 2009

Five Questions

(1) Define what constitutes a 'statement' in Javascript (JS)?

A statement gives a command to the browser and tells the computer what to do.

(2) Name three different types of JS variable?

Strings
Arrays
Objects

(3) Using JS array 'myarray', what is the syntax to access the 5th element?

Need a Multi pass to access the 5th Element





myarray [5]

(4) How would you use a string class to change some text to upper case?

Replace
var str="ramming speed";
document.write(str.replace ("RAMMING SPEED!!"));

or

var str="ramming speed!";
document.write(str.toUpperCase());


(5) What is a 'class' and how does it relate to the JS document object model (DOM)?

A class makes changes to an element, it can also make changes within a DOM

No comments: