True Basics Flashcards
How do you do one line comments in javascript ?
// enter comment here // enter comment2 here
How do you do multi-line comments in javascript?
/* comment blah blah blah */ this line ends the comment
How do you assign a value to a string variable?
var name = “george” ;
What does initializing a variable mean
assigning an initial value to a variable.
What date type does a variable value have if you do not assign a value?
undefined
Are variables case sensitive in javascript?
yes
Write three words together as one word to show you understand what camel case is.
helloMyFriend
What data type is the value 5 in javascript?
number
_____is a data type in javascript which represents numeric data
number
How do you add two numeric values in Javascript
5 + 5
How do you subtract two numeric values in javascript
7 - 3
How do you multiply two numeric values in javascript
7 * 3
How do you divide two numeric values in javascript
9 / 3
How do you increment the number of a variable in javascript (suppose i is the variable)
i++
How do you decrement the number of a variable in javascript (suppose i is the variable)
i–
What data type stores decimal numbers?
floating point
What is the operator for remainder
%
What what does the remainder operator return
The remainder that’s left over after division
Rewrite myVar = myVar + 5 into a compound assignment
myVar += 5
Rewrite myVar = myVar - 5 into a compound assignment
myVar -= 5
Rewrite myVar = myVar * 5 into a compound assignment
myVar *= 5
What does escaping a quote mean?
When you use the backslash from within quotations to include the same quotation character as a part of it.
How do you escape the “ character
"
How do you escape the ‘ character
'
how do you escape a backslash
\
how do you escape a new line?
\n
how do you escape a carriage return?
\r
how do you escape a tab?
\t
how do you escape a word boundary?
\b
how do you escape a form feed?
\f
How do you concatenate two string fields together?
“string content 1” + “string content 2”
How do you concatenate two strings together (through a variable) using the same sequence that represents incrementing a number?
var ourStr = "I come first. "; ourStr += "I come second.";
How do you find the length of the value of a variable
Assume variable is called variableName
variableName.length
How do you find the first character of a string variable
Assume variable is called variableName
variableName[0]
How do you find the second character of a string variable
Assume variable is called variableName
variableName[1]
How do you find the third character of a string variable
Assume variable is called variableName
variableName[2]
How do you find the last character in a string variable?
Assume variable is called variableName
variableName[variableName.length -1]
How do you find the second last character in a string variable?
Assume variable is called variableName
variableName[variableName.length -2]
_______ are the classifications we give to the different kinds of data that we use in programming.
data types
In JavaScript, there are _____ fundamental data types:
seven