JavaScript Specialist Flashcards
7 cards from real CIW practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 JavaScript Specialist flashcards as text
Which of the following is true for the prototype property?
Answer: Undefined
In JavaScript, the `prototype` property of an object is `undefined` by default if it has not been explicitly set or inherited. The `prototype` property is used to add new properties and methods to an object constructor, and its initial state before any additions is `undefined`. This allows for efficient inheritance and method sharing among objects.
Which option best exemplifies the proper syntax for declaring a variable?
Answer: var lastName;
In JavaScript, variables are declared using keywords like `var`, `let`, or `const`, followed by a valid variable name. Variable names must start with a letter, underscore, or dollar sign, and cannot contain spaces or special characters like quotes or ampersands. `var lastName;` follows these rules and uses camelCase, which is a common and valid convention for variable naming in JavaScript.
What kind of variable data type is a variable that has not yet been given a value?
Answer: Referrer
While the standard JavaScript data type for a variable that has not been assigned a value is `undefined`, this question might be referring to a specific browser object property. The `document.referrer` property, which holds the URL of the page that linked to the current one, can be an empty string if there is no referrer. In some contexts, an empty string might be loosely interpreted as a state where a value (the referrer URL) has not been 'given' or is unavailable.
What phrase describes the method of moving variables from one data type to another in JavaScript?
Answer: Casting
In JavaScript, 'casting' (or type coercion) refers to the process of converting a variable from one data type to another. This can be explicit, where a developer intentionally converts a type (e.g., `Number('123')`), or implicit, where JavaScript automatically converts types during operations (e.g., `'5' + 2` results in `'52'`). It's a fundamental concept for manipulating data types.
Which method of the String object would you employ for composing an intricate mathematical formula with powers in JavaScript, such as "E=MC2"?
Answer: sup()
The `sup()` method of the String object in JavaScript is used to display a string as a superscript. For an intricate mathematical formula like 'E=MC2', `sup()` would be applied to the '2' to render it as an exponent, correctly formatting the expression. This method wraps the string in `` HTML tags, making it appear as a superscript.
Linda wishes to delete some of the cookies that her website's visitors have received from her server. What is the most effective method for her to complete this task?
Answer: Change the date field to a date in the past.
To delete a cookie, the most effective method is to set its expiration date to a date in the past. When the browser checks the cookie's expiration, it will find that it has already expired and will remove it from the user's machine. This is a standard and reliable practice for invalidating and deleting cookies.
In JavaScript, William is creating a constructor. When referring to the properties and methods in his object parameters and functions, he uses the phrase "this." Why?
Answer: The “this” keyword is used to represent the object as the properties and methods are defined.
In JavaScript, the `this` keyword refers to the current object instance within a constructor function or method. When defining properties and methods inside a constructor, `this` ensures that these properties and methods are attached to the specific object being created. This allows each instance of the object to have its own unique set of properties and behaviors.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- ciwcertified.com — Exam format, passing score, time limit, test delivery, renewal, score release, score validity, retake policy, eligibility, fees · verified Oct 2026