Javascript Flashcards
(29 cards)
What is JavaScript used for?
used to create responsive, interactive elements for webpages that enhances user experience.
Is JavaScript considered as a programming language?
Yes.
Where can you insert JavaScript?
In head element, in body element, external file or external URL
What can JavaScript do?
It can change HTML content, change HTML attributes, Change CSS style, Show and hide HTML elements.
You do not need to add the type attribute in script tag. True or false.
True
The language attribute for the script tag is necessary. True or False?
False.
Is external file paid? (JavaScript)
No. Only external URL is paid.
How do you add external file or external URL? (JavaScript)
By adding the src attribute inside script start tag.
Does the script tag need an end tag?
Yes.
What are statements in JavaScript?
are syntax constructs and commands that perform actions.
Statements are separated using colons (:). True or false?
False. You have to use semi colons. (;)
How do you make a one-line comment in JavaScript?
// comment
How do you make a multiple line comment in JavaScript.
/* just like CSS */
The one line comment in JavaScript needs an end tag. True or false.
False.
Define a variable in JavaScript.
used to store values.
Name at least one data type/variable type
string, number, object, boolean.
A string does not require a double quote. True or false?
False. Without the double quote, it is not a string.
A number requires a double quote. True or false?
False. With a double quote, it will become a string. It will not perform the operation as expected, because it is a string not a number value.
What can you start your variable name with?
a letter, a dollar sign, and an underscore.
what does ‘+’ do in JavaScript?
It adds the two operands.
What does ‘-‘ do in JavaScript?
It subtracts.
What symbol do you use to multiply in JavaScript?
*
The forward slash ( / ) is used in JavaScript as an arithmetic operator to divide. True or false?
True.
What symbol do you use for the modulus operator and what does it do?
%. It returns the remainder.