Java was first developed by Sun Microsystems. Java programs are designed to be platform-independent, since they use a runtime called a Java Virtual Machine (JVM) to execute their code. Java isn’t a scripting language, however, so programs do need to be compiled into bytecode programs prior to execution.
For example, you could validate a form field as the user types, and only activate the submit button if the fields are correctly formatted. This could check that an email address is entered in the right field, or that a password is the correct length. This reduces the wait time for the user compared to if they had to submit the form all at once.
Express is a web application framework for Node.js, used for backend development.
React is another frontend framework similar to Angular.
In addition, variable names must start with a letter or the underscore character “_” — they cannot start with a number. For example, “_Variable123” or “variable123” are valid, while “123Variable” is not.
Boolean, e.g. True or False
String — a collection of non-numeric characters
Symbol — a new primitive type that returns a globally unique identifier.
Number — an integer
Undefined — a variable or property that doesn’t exist or hasn’t been assigned yet.
Null — a value that can be assigned to a variable representing no value.
7. What’s the purpose of the ‘This’ operator?
In HTML event handlers, “this” means the HTML object that received the event. For example, the “onclick” event for a button could specify “this.style.display=’none’”. When the button is clicked, its display would be set to None, effectively removing the button from the page.
8. What is the difference between “==” and “===” comparison operators?
The “===” operator compares variables without type conversion. So comparing a number variable to a string containing a number would work with ==, but not with ===.
3 == “3” //true
3 === “3” //false
Null is an assignment value. It can be assigned to a variable to represent a null, or no value.
Undefined means that a variable has been declared, but no value, and thus no type, has been assigned to it.
Undeclared means that a variable has not been declared in the program, and thus doesn’t exist. Attempting to call an undeclared variable will result in a runtime error.
NaN stands for “not a number”. If a variable of another type is not able to be converted into a number, NaN is returned instead. NaN always returns “false” when compared with a number variable, including itself, so it can be used in functions and methods where a number should be returned but isn’t due to an error.
10. What will this code output? 3 + 5 + “7”
One popular example of the “what does this output” question is this one — add three numbers together, but one of them is in quotation marks. If you guessed that this outputs “15”, then you’d be wrong! The correct answer is 87. This is because the + operator, when used with a string, means “concatenate”. So this code really says “add three and five, then concatenate the result with a string”.
Of course in the real world, having code like this would be confusing, but as a knowledge test, it’s quite effective.