Working with JavaScript Flashcards
(30 cards)
What is Debugging?
Debugging is the process of identifying and fixing errors in a code.
What is Logging?
Logging is a way to check code as it’s being developed.
What does Logging look like?
Logging looks like the printing of values to a display as the code runs.
What is the Console?
The Console is a tool which displays feedback like logs, and errors when things go wrong.
What do you write in JavaScript to ‘print’ something to the Console?
In JavaScript, you write console.log() to ‘print’ something to the Console.
What does console.log() let you see?
console.log() lets you see the output when the code is ran.
What will console.log(‘hello’) print to the console?
hello
What will console.log(4) print to the console?
4
What will console.log(4+10) print to the console?
14
Can Debugging check the data types of Variables?
Yes, Debugging can check the data types of variables.
What does the typeof operator do?
the typeof operator can tell you what kind of data type any kind of value is.
Can the typeof operator tell you what kind of data type values stored within variables are?
Yes
How do you see the data type printed to the console?
Combine the typeof operator with the console.log() to see the data type printed to the console.
What type will print to the console?
console.log(typeof ‘hello’);
the console will print the type ‘string’
What type will print to the console?
console.log(typeof 4);
the console will print the type ‘number’
What type will print to the console?
console.log(typeof(9+5));
the console will print the type ‘number’
Why is there an extra bracket?
console.log(typeof(9+5));
There is an extra bracket because the expression needs to evaluate itself first before it can identify the final data type.
What type will print to the console?
console.log(typeof name);
The console will print the type ‘string’
What are Comments?
Comments in JavaScript are text within code that are ignored by the JavaScript Coding Engine when running the code.
What are Comments used as a Tool for?
Comments are used as a tool for Planning and for communication with other developers. It’s good for trying to recall the reason behind doing something the way you did.
What is the syntax for Single-Line Comments?
// is the syntax for single line comments
What is the syntax for Double-Line Comments?
/* is the syntax for multi line comments
Is the syntax for Double-line comments reversed at the end?
Yes.
What is Pseudocode?
Pseudocode is the common term given to code that expresses a sequence of code in human language.