Fichas
Javascript
Fichas del conjunto (22)
- 1How do you make a comment / multi line comment in javascript?// for comment.
/*
and
*/
for multi line comment - 2What are the seven types of data?undefined - null - boolean - string - symbol - number - object
- 3How do you declare a javascript variable?var myVariable = __;
- 4What is the "=" called in javascript?the assignment operator
- 5When javascript variables are just declared what value do they have?they default to undefined. would output as NaN (Not a Number)
- 6What does ++ or -- do?increments.
It adds or minuses 1 to the variable.
x++; / x--;
is the same as
x+1; x-1; - 7What are decimal numbers referred to as?floats or floating point numbers
- 8What does the remainder operator do? %gives the remainder of the division of two numbers.
(the leftover after a divide w/o decimals)
5 % 2
(2 goes in five twice then theres 1 leftover)
remainder 1 - 9What does += or -= do when assigning?It adds/minuses the value to the variable.
a = a + 5;
a += 5; - 10how do you put quotes in a string variable without javascript thinking it's the start/end of the string.use the backlash.
ex:
var string = "start but /"this parts quotes now in the string" \ now end"; - 11What is the concatenation operator?+ sign in strings.
use it to connect multiple strings together.
Concatenation does not add spaces between concatenated strings though so you gotta. - 12How do you add variables between strings? qWith the +
var string = "My name is" + myName + "and dont wear it out"; - 13What is Zero-based indexing?Where you start counting from 0
- 14How do you use bracket notation and what is it ?Use it to notate and select a part out of a variable/array. (starts from 0)
var name = "Xander";
name[0]; = "X"
name[2]; = "n" - 15What is .shift(); and .unshift();?Shift takes things off the begginning of an array.
Unshift will add them to the beginning of an array. - 16What is .pop() and .push();?Pop pops thing off the end of an array.
Push adds things to the end of an array. - 17What is the difference between == and ====== tests the data and value type while == only tests value
- 18What does != do?It tests if two things are not equal.
- 19What does && do?Tests if two things are either true or false.
(value >=10 && value <= 20)
tests if it's between 10 AND 20 - 20Describe Javascript Object syntaxmyObj {
property: value,
property2: value2
};
(semicolon after curcly bracket at end.
properties end with colon :
values end in comma , except for last one) - 21What are two way to access Object property values?with dot notation. myObj.property;
or bracked notation
myObj["property];
^ note property has to be in quotes with bracket - 22—
Información
- Descripción
- (Front End Development ) Free Code Camp Notes Fichas sobre Javascript, creado por Alexander Lynds el 01/06/2017.
- Creado por
- Alexander Lynds · jun 2017
- Actualizado
- 6 jun 2017
- Visitas
- 0
- Valoración