JavaScript Test Questions and Answers, Exams of Advanced Education

A series of questions and answers related to javascript programming. It covers fundamental concepts such as functions, objects, memory management, and various methods and properties of built-in javascript classes like math, number, string, date, array, and regexp. The questions address topics including object-oriented programming principles, array manipulation, string handling, regular expressions, and secure coding practices. This resource is useful for students and developers looking to test their knowledge and understanding of javascript concepts and syntax, offering a comprehensive review of key elements in the language.

Typology: Exams

2025/2026

Available from 10/30/2025

EXAMGUIDE
EXAMGUIDE 🇺🇸

4.4

(33)

32K documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
JAVASCRIPT TEST 3 QUESTIONS AND
ANSWERS
A(n) ____ function is a function that is used as the basis for a custom object. - Correct
Answers -constructor
A(n) ____ is an object that has been created from an existing class. - Correct Answers -
instance
____ refers to cleaning up, or reclaiming, memory that is reserved by a program. -
Correct Answers -Garbage collection
Which method of the Math object rounds a value to the next lowest integer? - Correct
Answers -floor()
he code (methods and statements) and data (variables and constants) contained in an
encapsulated object are accessed through a(n) ____. - Correct Answers -interface
To execute the same statement or command block for all the properties within a custom
object, you can use the ____ statement. - Correct Answers -for/in
A(n) ____ array is an array whose elements are referred to with an alphanumeric key
instead of an index number. - Correct Answers -associative
Which class requires you to use a constructor? - Correct Answers -Date
The ____ property is a built-in property that specifies the constructor from which an
object was instantiated. - Correct Answers -prototype
When creating an object using a literal, you separate multiple property-value pairs with
____. - Correct Answers -commas
Which Number class method can you use to convert a number to a string that is
formatted with local numeric formatting style? - Correct Answers -toLocaleString
Programming code and data that can be treated as an individual unit or component -
Correct Answers -object
pf3
pf4
pf5

Partial preview of the text

Download JavaScript Test Questions and Answers and more Exams Advanced Education in PDF only on Docsity!

JAVASCRIPT TEST 3 QUESTIONS AND

ANSWERS

A(n) ____ function is a function that is used as the basis for a custom object. - Correct Answers -constructor A(n) ____ is an object that has been created from an existing class. - Correct Answers - instance ____ refers to cleaning up, or reclaiming, memory that is reserved by a program. - Correct Answers -Garbage collection Which method of the Math object rounds a value to the next lowest integer? - Correct Answers -floor() he code (methods and statements) and data (variables and constants) contained in an encapsulated object are accessed through a(n) ____. - Correct Answers -interface To execute the same statement or command block for all the properties within a custom object, you can use the ____ statement. - Correct Answers -for/in A(n) ____ array is an array whose elements are referred to with an alphanumeric key instead of an index number. - Correct Answers -associative Which class requires you to use a constructor? - Correct Answers -Date The ____ property is a built-in property that specifies the constructor from which an object was instantiated. - Correct Answers -prototype When creating an object using a literal, you separate multiple property-value pairs with ____. - Correct Answers -commas Which Number class method can you use to convert a number to a string that is formatted with local numeric formatting style? - Correct Answers -toLocaleString Programming code and data that can be treated as an individual unit or component - Correct Answers -object

Type of array that enables you to add object properties incorporating numbers - Correct Answers -associative Elements required for a source program to communicate with an object - Correct Answers -interface A template, or blueprint, that serves as the basis for new objects - Correct Answers - class Returns the square root of the specified value - Correct Answers -sqrt() Converts a number to a string using the number of decimal places specified - Correct Answers -toFixed() The easiest way to declare a custom object - Correct Answers -literal Returns a value rounded to the nearest integer - Correct Answers -round() Creates a Date object containing the current date - Correct Answers -new Date() A function assigned a name within a custom object - Correct Answers -method The term ____ refers to information contained within variables or other types of storage structures. - Correct Answers -data You can create a function that will be used as an object method by referring to any object properties it contains with the ____ reference. - Correct Answers -this To add a property to a constructor function, you must add a statement to the function body that uses the ____ keyword. - Correct Answers -this The ____ class contains methods and properties for manipulating the date and time. - Correct Answers -Date The ____ class contains methods and properties for performing mathematical calculations in your programs. - Correct Answers -Math The ____ class contains methods for manipulating numbers and properties that contain static values representing some of the numeric limitations in the JavaScript language. - Correct Answers -Number When working with a date, JavaScript stores the month as a ____. - Correct Answers - value from 0-

Special character that defines pattern matching rules in a regular expression - Correct Answers -metacharacter Metacharacter that specifies the quantity of a match - Correct Answers -quantifier Adds one or more elements to the end of an array - Correct Answers -push() Characters contained in a set of parentheses within a regular expression are referred to as a subexpression or ____. - Correct Answers -subpattern The ____ method of the String class returns the position number in a string of the first character in the argument. - Correct Answers -indexOf() You use ____ classes in regular expressions to treat multiple characters as a single item. - Correct Answers -character The ____ method removes and returns the first element from the beginning of an array.

  • Correct Answers -shift() The ____ object contains methods and properties for working with regular expressions in JavaScript. - Correct Answers -RegExp The ____ method adds one or more elements to the end of an array. - Correct Answers -push() You use the ____ method of the String class to split a string into an indexed array. - Correct Answers -split() The ____ method returns the position number in a string of the first instance of the first character in the pattern argument. - Correct Answers -search(pattern) To allow a string to contain an alternate set of substrings, you separate the strings in a regular expression pattern with the ____ metacharacter. - Correct Answers -| The String class ____ property returns the number of characters in a string. - Correct Answers -length A pattern that matches the beginning or end of a line is called a(n) ____. - Correct Answers -anchor The fromCharCode() method is called a ____ method because it is not used as a method of any string objects (which can be literal strings or variables) in your scripts. - Correct Answers -static Also known as defensive coding - Correct Answers -secure coding

Converts the Date object to a string, formatting it in Coordinated Universal Time - Correct Answers -toUTCString() Temporarily stores data that needs to be sent to a server along with the rest of a form, but that a user does not need to see - Correct Answers -hidden form field Encrypts data and transfers it across a secure connection - Correct Answers -SSL The only required parameter of the cookie property - Correct Answers -name attribute Allows cookies to be shared across a server - Correct Answers -path attribute Consists of a single text string containing one or more pieces of information - Correct Answers -query string Converts special characters in the individual parts of a URI to their corresponding hexadecimal ASCII value, preceded by a percent sign - Correct Answers - encodeURIComponent() Restricts how JavaScript code in one window or frame accesses a web page in another window or frame on a client computer - Correct Answers -same origin policy Storage that remains until you run code to delete it - Correct Answers -localStorage ____ refers to the writing of code in such a way that minimizes any intentional or accidental security issues. - Correct Answers -Secure coding ____ cookies remain available beyond the current browser session and are stored in a text file on a client computer. - Correct Answers -Persistent You use the ____ property of the Document object to create cookies in name-value pairs. - Correct Answers -cookie The ____ property of the Location object contains a URL's query or search parameters.

  • Correct Answers -search The ____ attribute of the cookie property determines how long a cookie can remain on a client system before it is deleted. - Correct Answers -expires You separate individual name-value pairs within a query string using ____. - Correct Answers -& HTTP was originally designed to be ____, which means that web browsers stored no persistent data about a visit to a website. - Correct Answers -stateless