JavaScript, web development questions
with actual answers.
programming ANS -the process of taking a problem stated in plain language and writing a set of
instructions to handle the problem (algorithm) in terms your computer can understand (programming
language)
program ANS -a set of instructions for a computer to carry out
algorithm ANS -a step-by-step procedure for solving a problem
jQuery ANS -Popular 3rd party Javascript library
const ANS -Prefix keyword to make a variable constant, you can't change its value
let ANS -Prefix keyword to make a variable that you CAN (but don't need to) change its value
* can be declared without initially setting a value (example=> let myVar;
var ANS -an older way to declare a variable, used in legacy code, differs from `let` slightly when it comes
to variable scope
null ANS -data type that represents a variable with no assigned value
undefined ANS -data type that hasn't been assigned a value. You wouldn't want to purposefully assign
`undefined` as a value but you can always to see if a variable is (or is not)
data types ANS --string(letters/words/unicode characters)
-number (whole or decimal numbers)
-boolean (true/false)
-null (no assigned value)
,-undefined (don't assign this type)
-functions (not technically a data type)
-objects (complex data type--combines primitive data types)
coercion ANS -JS "forcing" a data type to match that of another when you use an operator such as `+`.
EXAMPLE:
const stringVar = 'Kilroy was here ';
const numVar = 12;
const combined = stringVar + numVar;
typeof combined; // => string
console.log(combined); // => Kilroy was here 12
hoisting ANS -JavaScript engine sets up memory for variables and functions that you have made. It is a
way browsers reads through JS...first from top to bottom it identifies all variables and declares space for
them THEN it goes through and executes commands (like functions)
DOM ANS -*the way developers can manipulate webpages using JS
function call sign ANS -( ) .... refers to the arguments or parameters — if any — that get passed to a
function
determinate ANS -In regards to FUNCTIONS...Given the same inputs on separate invocations, the result
should be exactly the same.
function declaration ANS -function myFunction() {
console.log("myFunction");
}
function expression ANS -const myFunction = function(arg1, arg2) {
, console.log("myFunction");
};
**this is a valid way to create a function and some development teams MAY prefer this way
arrow functions ANS -=>
const add = (num1, num2) => num1 + num2;
add(2, 3) // => 5;
// same as above...just uses function keyword
instead of arrow
const addAlt = function(num1, num2) {
return num1 + num2;
}
function ANS -* a block of instructions that can be called on in
code
* a little "machine" that does a specific thing
quotation mark delimiter ANS -'\' --- use the backslash to escape the quotation
mark delimiter
EXAMPLE: const talkSome = "I said \"hi there\"";
* `\` is also used to break long strings into
separate lines
string methods ANS -some examples are:
const fooBar = 'foo bar foo bar';
fooBar.length; // => 15
with actual answers.
programming ANS -the process of taking a problem stated in plain language and writing a set of
instructions to handle the problem (algorithm) in terms your computer can understand (programming
language)
program ANS -a set of instructions for a computer to carry out
algorithm ANS -a step-by-step procedure for solving a problem
jQuery ANS -Popular 3rd party Javascript library
const ANS -Prefix keyword to make a variable constant, you can't change its value
let ANS -Prefix keyword to make a variable that you CAN (but don't need to) change its value
* can be declared without initially setting a value (example=> let myVar;
var ANS -an older way to declare a variable, used in legacy code, differs from `let` slightly when it comes
to variable scope
null ANS -data type that represents a variable with no assigned value
undefined ANS -data type that hasn't been assigned a value. You wouldn't want to purposefully assign
`undefined` as a value but you can always to see if a variable is (or is not)
data types ANS --string(letters/words/unicode characters)
-number (whole or decimal numbers)
-boolean (true/false)
-null (no assigned value)
,-undefined (don't assign this type)
-functions (not technically a data type)
-objects (complex data type--combines primitive data types)
coercion ANS -JS "forcing" a data type to match that of another when you use an operator such as `+`.
EXAMPLE:
const stringVar = 'Kilroy was here ';
const numVar = 12;
const combined = stringVar + numVar;
typeof combined; // => string
console.log(combined); // => Kilroy was here 12
hoisting ANS -JavaScript engine sets up memory for variables and functions that you have made. It is a
way browsers reads through JS...first from top to bottom it identifies all variables and declares space for
them THEN it goes through and executes commands (like functions)
DOM ANS -*the way developers can manipulate webpages using JS
function call sign ANS -( ) .... refers to the arguments or parameters — if any — that get passed to a
function
determinate ANS -In regards to FUNCTIONS...Given the same inputs on separate invocations, the result
should be exactly the same.
function declaration ANS -function myFunction() {
console.log("myFunction");
}
function expression ANS -const myFunction = function(arg1, arg2) {
, console.log("myFunction");
};
**this is a valid way to create a function and some development teams MAY prefer this way
arrow functions ANS -=>
const add = (num1, num2) => num1 + num2;
add(2, 3) // => 5;
// same as above...just uses function keyword
instead of arrow
const addAlt = function(num1, num2) {
return num1 + num2;
}
function ANS -* a block of instructions that can be called on in
code
* a little "machine" that does a specific thing
quotation mark delimiter ANS -'\' --- use the backslash to escape the quotation
mark delimiter
EXAMPLE: const talkSome = "I said \"hi there\"";
* `\` is also used to break long strings into
separate lines
string methods ANS -some examples are:
const fooBar = 'foo bar foo bar';
fooBar.length; // => 15