Question: What goes in the parentheses after a function?
Answer: The parameters of the function.
Question: A boolean has two values. What are they?
Answer: True/False
Question: What does a conditional statement do?
Answer: A conditional statement poses tests, and performs actions depending on the results of the tests.
Question: How would the script look to write a loop that goes from 0 to 100 by 5's?
Answer: for(i=0;i<101;i+5) { document.write("<p>"+i+"</p>") }
Question: How many slots are in the Array: new Array(10,20,30,40,50)?
Answer: Five slots
Question: What is one way to assign a value to a slot in an Array?
Answer: NameofArray[0]=5 NameofArray[1]=10
Question:Name 3 things that can be stored in an array
Answer:Strings of numbers, letters (ascii), boolean values. Names of images, names of HTML documents are examples of letters.
Question:What is the index of the first value in an array?
Answer:Zero
Question:True or False: Java and Javascript are, for all intensive purposes, the same thing.
Answer:False. They are two very different programming languages.
Question:Why is the use of functions useful in Javascript programming
Answer:It simplifies the code making it eaiser to read and understand. Somtimes it can reduce the number of lines of code the programmer has to write. It also makes code eaiser to debug.
Question:Why are some variables used in a function not valid outside of that function?
Answer:They are local variables whose scope and duration have expired.
Question:Name 3 things that Browser plug-ins provide the Web page author?
Answer: sounds, video, and animation.
Question:What kind of loop is used in our JavaScript book and what is it named after?
Answer: the "for" loop, named after the command that begins the loop.
Question:What is it called when you want to take some information and give it to a function to be processed?
Answer: "passing" the information.
Question:How does one hide javascript from old browsers?
Answer:With the line "<!-- Hide script from old browsers" .
Question:What marks immediately after a function name denote the function and are a necessary part of it?
Answer: A set of parentheses
Question:A string is usually enclosed with what marks?
Answer: quotation marks
Question: In Java what is a method a description of?
Answer: A method is the actions that an object does.
Question: In javascript what is a string?
Answer: A string is text in the java code that is interpreted literally. It is a sequence of ASCII characters.
Question: What are comparison statements?
Answer: Values that are true or false; x>y.
Question: What is a function good for?
Answer: It is a simpler and easier way of compacting certain parts of java code.
Question: What is the duration?
Answer: Duration is the time when a variable exists in memory.
Question:What are some advantages of using JavaScript?
Answer:JavaScript allows your site to be more interactive with the user. You can make sure info. is valid, do calculations, give feedback, test for plug-ins, and much more.
Question:What does it mean to say that JavaScript is an "object-oriented" language?
Answer:This means that in Web browsers, JavaScript works with objects (windows, buttons, forms, etc.). These objects have certain properties, which modify them, and their objects can have sub-objects. The objects and sub-objects can do things, which are called methods. When you put all these elements together you make a language that describes a process.
Question:List any three value types.
Answer: number, function, object, boolean, null, string
Question: What are "operators?"
Answer:They are the symbols used to work with variables. They use plus and minus signs, asterisks, percentages, and back-slashes to define different actions.
Question:Write the necessary script of a function.
Answer:
function name_of_function(paramenter_list) { code goes here }
Question: What is the notation for sending a message in Javascript?
Answer: object. sub-object.method(parameters);
Question: What is a method?
Answer: An action an object is able to do.
Question: What is another name for a conditional statement?
Answer: A boolean statement.
Question: What is a local variable?
Answer: Function parameters and any variables defined (using var) in a function body.
Question: Write the mathmatical expression A>B>C as a boolean expression.
Answer: (A>B)&&(B>C)
Question: When performing a loop, "i" starts out with what value?
Answer: i can start at whatever you want it to start at. In the "for" loop we set (i=x; .. ; .. ). Here, x can be any number.
Question: how is the # of values in an array specified?
Answer: array_name.length
Question: where do functions go in the html document?
Answer: in the header or the body
Question:How do you comment out a section of your script?
Answer: Mark the beginning of the section with /* and end it with */
Question:Why do we use functions?
Answer:Because they compact our code and make it easier to repeat the same action multiple times.
Question:If you have a function that you want to place at the end of the message "Today is..." what is the proper notation? Note, the function must have a return value.
Answer:("Today is" + functionName( ))
Question:What is the notation for the beginning tag for Javascript?
Answer:<script language=javascript type="text/javascript">
Question:Can you have more than one Javascript on a single web page?
Answer:Yes, all you need to do is end one with a </script> and begin a new one below it.
Question:If the word "cat" were a Javascript string, in what position would the letter "t" be?
Answer:The second, because it would start with the 0th, then the 1st, then the 2nd.
Question:What will Math.random() give you?
Answer:A random number between 0 and 1
Question: Define duration
Answer:The time when a variable exists in memory.
Question: Write the following in JavaScript form. It is not true that A and B are both zero.
Answer: !(A==0 and B==0)
Question: What is a function?
Answer: A function is a set of javascript statements that performs a task.
Question:How many times can you call a function?
Answer: Functions can be called as many times as needed during the running of the script.
Question: T or F; Javascript must be placed in the head section.
Answer: False--Javascript can be placed in the head or the body section.
Question:What are "boolean variables"?
Answer:Variables that contain the value true or false
Question:What is another name for "conditional statements"?
Answer:boolean statements
Question:What are member variables?
Answer:They are the "data" - the information that objects know.
Question:Define nested loops.
Answer:Nested loops are loops within existing loops.
Question:What is scope?
Answer:A region of code where a variable is recognized.
Question:What do return values do?
Answer:Once an object has performed an action, it sends information back to the object that sent the message.
Question:How do events relate to event handlers?
Answer:Event handlers are Java Script commands that are triggered by events.
Question:What command identifies that you are using javascript in your script?
Answer:<script language=javascript type="text/javascript">
Question:T or F: Loops can be used to calculate the sum of a long list of numbers.
Answer: True
Question:T or F: Loops can only be used to calculate the sum of a list of consecutive numbers.
Answer:False
Question:T or F: If you have an infinite loop, your page will not load at all.
Answer:False
Question:T or F: Once an array is created you can set the value of individual elements using assignment statements.
Answer:True
Question: What type of statement uses a single equals sign?
Answer: Assignment statement
Question: What type of statement uses a double equals sign?
Answer: Comparison statement
Question: True of False: Javascript does not allow the creation of empty arrays.
Answer: False.
Question: The first slot in an Array's index is what number?
Answer: Zero.
Question:How do you comment out a section of your script?
Answer: You put a slash and an asterisk before the text and an asterisk and a slash at the end.
Question: When using an alert window, what does Netscape include automatically?
Answer: Text telling the user that the box was put up by a JavaScript command.
Question: What are two kinds of conditional statements?
Answer: If-then and while.
Question: What is the first thing you have to define in a script?
Answer: The language the script is in.
Question: What three sections do a conditional have?
Answer: If. Then. Else. The Else section is optional.