Level 123 Level 125
Level 124

[Quiz] Object-Oriented


30 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
Primitive types and Reference types.
What are the names of the two different data types in JS?
What are Primitive types?
Primitive types are stored as simple data types and represent simple piece of data that are stored.
There are five primitive types in JS are:
How many primitive types are there and what are some examples of each?
Because each variable containing a primitive value uses its own storage space.
Why do two variables that contain primitive values the same value have independent changes not affect them?
What are Reference types?
Reference types are stored as objects, which are just really just references to locations in memory.
What is an object in js?
In JavaScript, almost "everything" is an object.
What are some ways to create or instantiate objects?
The first is to use the new operator with a constructor. A constructor is simply a function that uses new to create an object - any function can be a constructor. When you assig…
How and why is it a good idea to deference objs in JS?
Although JS is a garbage-collected lang, it is a good idea to deference an obj by setting it to null after it is used to free up memory for something else.
By using either dot or bracket notation.
How can you add or remove properties in JS?
How to identify reference types?
Apart from the function obj, all other reference types are hard to identify, just like null the primitive. So, we use instanceOf to identify the reference type.
What are primitive wrapper types?
There are three primitive wrapper types, String, Boolean and Number. They exist to make working with primitive values as ez as it is to work with objects.
What distinguishes functions from other objects in JS?
The presence of an internal property named [[Call]]. Internal properties are not accessible via code but rather define the behavior of code as it executes.
What are the two literal forms of functions?
1)Function declaration - Begins with the function keyword and includes the name of the function immediately following it.
What is the key difference between function declarations and function expressions?
Function declarations aka the non-anonymous ones are hoisted to the top of the context(Either the context in which the function occurs or the global scope) when the code is executed. That means you can actu…
Arguments
What are function parameters called?
What is one unique aspect of JS?
You can pass any number of parameters to any function without causing any error.
What is a function's arity?
The number of parameters it expects.
What is function overloading and does JS support it?
Function overloading is the ability of a single function to have multiple signatures. A function signature is made up of the function name plus the number and type of parameters the functions expects. JS do…
What is this in JS?
Every scope in JS has a this obj that represents the calling object for the function. In the global scope, this represents the calling global object(window in web browsers). When a function is called w…
call(), apply(), bind()
What are three function methods that allow you to change the value of this?
What does call() do in the context of this in JS?
call() executes the function with a particular this value and with specific parameters.
What does apply() do in the context of this in JS?
apply() works exactly the same as call() except that it accepts only two parameters: the value for this
What is an own property in JS?
An own property simply indicates that the specific instance of the object owns that property.
What is a reliable way to check if a property exists on an object?
The in operator looks for a property with a given name in a specific object and returns true if it finds it. If however you want to check for the existence of a property …
What does Enumeration mean?
By default all properties you add to an object are enumerable, which means that you can iterate over them using a for-in loop. There is a difference between the enumerable properties returned in a fo…
Data properties and accessor properties
What are the two different types of properties?
What are data properties?
Data properties contain a value, like the name property below.
What are accessor properties?
They don't contain a value but instead define a function to call when the property is read(called a getter) and a function to call when the property is written to(called a setter). Accessor props …
Configurable.
Enumerable determines if a property can be iterated over, so what determines if a property can be changed?
What is a constructor in JS?
A constructor is simply a function that is used with new to create an object. Some examples of built in JS constructors are Object, Array and Function. Constructor functions should begin with a capital let…