Level 22
Level 24
54 words 0 ignored
Ready to learn
Ready to review
Ignore words
Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.
Ignore?
What is a string?
An immutable ordered sequence of 16-bit values which typically represent a unicode character
Empty string
A string with the length of 0
\n
how do you break a string literal across multiple lines?
what is an escape squence
a backslash that allows you to escape from the usual interpretation of the single-quote character
What Javascript values convert to false?
undefined, null, 0, -0, NaN, "" (empty string)
null
empty object pointer, null == undefined is true, you can set variable explicitly to null
Global object
a regular JS object that has globally defined symbols that are available to the JS program. When first created, the global object defines all of JavaScript's predefined global values, but also grows to hold program values.
Method
a function associated with an object
Wrapper objects
the temporary objects created when you access a property of a string, number, or boolean
Are two objects equal if they contain the same properties?
No, because objects are not compared by value. Instead, two objects are the same if and only if they reference the same underlying object.
How do you explicitly convert a type?
Use functions String(), Boolean(), Object(), and Number()
How does toFixed() method help prevent floating point decimals?
converts number to a string with a specified number of decimal points behind it
Scope
the region of your program the program source code is defined in
function scope
variables are visible within the function in which they are defined and within any functions that are nested within that function
Are global variables configurable?
No, they cannot be deleted with the delete operator.
scope chain
a list or chain of objects that defines variables that are "in scope" for that code
<script></script>
javascript can be embedded into html using these tags
alert()
allows the program to display a special dialog box that will notify the user that an expected event has occurred
window.status=
allows user to see message in the browser status line
array
simple collection of similar objects that can be accessed by a variable name/index
cycling banner
several graphics displayed one after another with a pause between images
hyperlink rollover
triggered when the user moves the mouse over a hyperlink
image rollover
change the appearance of an image whenever the user moves the mouse pointer over and off of it
onMouseOver
triggered when the mouse cursor is located over a form field
onMouseOut
triggered when the mouse cursor leaves the form field
doSubmit()
function that calls up an activity when visitor submits form
validateText()
function that returns a value from a text box; either true or false
setTimeout()
sets a time frame for JavaScript functions to operate
onLoad()
event triggered when the Web browser has finished loading the body of the HTML Web page.
doClear()
function that erases any existing form data
validateRadio()
function that returns a value from a radio button; either true or false
prevImage()
changes image that is currently displayed on the screen to the former image
External JavaScript
JavaScript code written separately in order to be brought into a document
nextImage()
changes image that is currently displayed on the screen to the next image
Math.random()
function that generates random numbers with decimals
Create a variable
var color = "red";
document.getElementById('myDiv').style.background="black";
Returns the div with the ID of 'mydiv' and adds a background style with attribute of black
document.getElementById(myDiv').style.color = "#ffffff";
Sets the font color to white
myDiv.style.color = "#ffffff";
Sets the font color of 'myDiv' to white
Characters of variables
a-zA-Z0-9_$ but NOT a number in the begining. But you can do a number after the first character
function sayHello () {
creates a function named sayHello
function sayHello (pirameters) {code}
function sayHello () {
Global vs. local variables.
In other words, what is the scope of the variable? Variables defined within functions cannot be called upon from outside of the function.
Can you access a variable of a function's function within the top function?
Yes. You can use a variable any levels deep within a function, but you cannot use these variables on a global level.
This will cause major errors.
If a variable is declared within a function without "var" before it it will create a global variable.
Hoisting the variable
The variable is pulled within an if statement even if it is false.
Put variables on more than one line
var color = "blue", name = "jim, patty;
Escape characters by adding a \ before them.
How to include " and ' within a string
string.indexOf("World");
Finds out if "World" exists within the 'string'
console.log("W does not exist");
Checks to see if W exists in string
string.charAt(2)
Returns the single character AT index #2
var world = string.substr(start, length);
Returns an extraction of a string based on index of characters
string.toUpperCase()
Uppercase and lowercase methods
True
False