Over all Review Flashcards
What is a string?
Strings are blocks of texts. They will always have single or double quotation marks around them.
What is a number?
Numbers are just numbers, they do not have quotes around them.
What is a primitive data type?
String, Number, Boolean
What is a boolean?
true or false
What is undefined?
A variable that does not have a value yet, what you are looking for doesn’t exist.
What is null?
______ is an object that we (developers), set as no value.
What is the || used for?
The logical OR (||) operator for a set of operands is true if and only if one or more of its operands is true
What is are comparison operators?
__________ are used in logical statements to determine equality or difference between variables or values. They are also used to test for true or false.
What is an object?
A data type that can be used to store a collection of data.
What is key:Value pairs?
Objects use key:value pairs to house data. The key is the identifier and the value is the value we want to save to that key.
How do you write a key:value pair?
const user { username: 'your name', password: 'password1234!', age: 43, hobby: 'soccer' }
What are JavaScript Data Types?
Number String Boolean Object Undefined
What is the use of isNaN function?
isNan function returns true if the argument is not a number otherwise it is false.
Between JavaScript and an ASP script, which is faster?
JavaScript is faster. JavaScript is a client-side language and thus it does not need the assistance of the web server to execute.
What is negative infinity?
Negative Infinity is a number in JavaScript which can be derived by dividing negative number by zero.
Where do “data types” come into play?
Data you work with in your code is of different - e.g numbers, text, etc.
What object do you use to access the short descriptions for standard HTTP status codes?
http.STATUS_CODES
What are global variables? How are these variables declared and what are the problems associated with using them?
Global variables are those that are available throughout the length of the code, that is, these have no scope. The var keyword is used to declare a local variable or object. If the var keyword is omitted, a global variable is declared.
What is a prompt box?
A prompt box is a box which allows the user to enter input by providing a text box. Label and box will be provided to enter the text or number.
What is the global object we can access the current version of node and arguments passed into the command line?
process
What is ‘this’ keyword in JavaScript?
‘This’ keyword refers to the object from where it was called.
What HTTPS(https) API is available in which environments?
NodeJS
What’s the property on the process object that lists all arguments passed into the command line?
argv
The String object is what type of object?
Native
What is the difference between ViewState and SessionState?
‘ViewState’ is specific to a page in a session.
‘SessionState’ is specific to user-specific data that can be accessed across all pages in the web application.
What is === operator?
=== is called as strict equality operator which returns true when the two operands are having the same value without any type conversion
Explain how can you submit a form using JavaScript?
document.form[0].submit();
Is there anything you have to be careful when using node.cloneNode()?
While cloning, make sure you didn’t duplicate the ID.
How could you prevent multiple event handler to be fired for an event?
If event listeners are attached for the same type event (click, keydown, etc.) of an element for the same event type, you can call event.stopImmediatePropagation() in the first event handler. No other event handler will be executed.
Can you remove an event handler from an element?
Yes. target.removeEventListener(‘click’, handler)
How could you stop further propagation of an event?
Call event.stopPropagation();
How could you prevent a click on an anchor from going to the link?
preventDefault() inside event handler. However, this doesnt stop further propagation.
How could I verify whether one element is child of another?
First check whether the passed parent is the direct parent of the child. If not, keep moving upward to the root of the tree.