Chapter 1 - Getting Started With Javascript Flashcards
Is The type attribute needed in the script tag?
Not in HTML5 but in HTML4
How to apply Javascript to a web document?
With older browser, how to make sure the user agent does not display the Javascript code?
By using HTML comments:
Javascript syntax : //
Indicates that the rest of the current line is a comment and not code to be executed.
JavaScript Syntax : /*
Beginning of a multiline comment
JavaScript Syntax : */
End of a multiline comment
JavaScript Syntax : Curly Braces ( { and } )
Used to indicate a block of code
JavaScript Syntax: semicolon ( ; )
End of a statement (single command)
JavaScript Syntax: Newline
End of a statement (single command)
How to declare a variable?
Var TheNameOfTheVariable =
Do “if” and “else” need a semicolon At the End of the line?
No, they are considered as single statement
Alert()
Display what is between the ( )
What is a function?
It is a naked, reusable block of code, surrounded By curly braces, that you create to perform a task
How to call a function?
Simply writes It’s name followed By parenthesis With the parameters inside the parenthesis
When calling a function, do I have to use the parenthesis even if there is no parameters?
Yes