Docsity

D278 SCRIPTING AND PROGRAMMING FOUNDATIONS PA OA COMPREHENSIVE STUDY GUIDE, Exams of Programming Paradigms

Toggle sidebar
bg1
D278 SCRIPTING AND
PROGRAMMING FOUNDATIONS PA
OA COMPREHENSIVE STUDY
GUIDE
โ—‰ How is a scripting language different then a programming
language?
Answer: It is read line by line by an interpreter that scans the code
for errors as it runs so it does not need to be compiled.
โ—‰ What is a markup language?
Answer: language that defines content, structure, and appearance of
a document.
โ—‰ What type of language is Javascript?
Answer: scripting language
โ—‰ what is JavaScript based off of?
Answer: standards of ECMA Script - constantly developed and
adapted to meet needs of modern browsers and devices
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download D278 SCRIPTING AND PROGRAMMING FOUNDATIONS PA OA COMPREHENSIVE STUDY GUIDE and more Exams Programming Paradigms in PDF only on Docsity!

D278 SCRIPTING AND

PROGRAMMING FOUNDATIONS PA

OA COMPREHENSIVE STUDY

GUIDE

โ—‰ How is a scripting language different then a programming language? Answer: It is read line by line by an interpreter that scans the code for errors as it runs so it does not need to be compiled. โ—‰ What is a markup language? Answer: language that defines content, structure, and appearance of a document. โ—‰ What type of language is Javascript? Answer: scripting language โ—‰ what is JavaScript based off of? Answer: standards of ECMA Script - constantly developed and adapted to meet needs of modern browsers and devices

โ—‰ What are the three foundations of javascript? Answer: scripting language ECMAScript, document object model (DOM), browser object model โ—‰ DOM Answer: describes how to access contents and actions within a web page โ—‰ BOM Answer: describes how to access features and behaviors of the browser โ—‰ Specifications of DOM Answer: Maintained by world wide web consortium (W3C) - also responsible for development standards for HTML and CSS โ—‰ Specifications of BOM Answer: determined by each browser. Common set of standards have been adopted by all browsers to make coding more accessible โ—‰ How can JavaScript programs be created?

โ—‰ What does the script element do? Answer: tells a web browser that the scripting engine must interpret the commands it contains. โ—‰ What is an object in programing? Answer: programming code and data that can be treated as an individual unit or component โ—‰ Procedures associated with an object Answer: methods โ—‰ Property Answer: piece of data which is associated with an object โ—‰ Is JavaScript case sensitive? Answer: yes โ—‰ Variables Answer: values that a program stores in computer memory โ—‰ reserved words (keywords)

Answer: special words part of JavaScript language syntax โ—‰ Expression Answer: Any unit of code that can be evaluated to a value โ—‰ Event Answer: An interaction from the user that triggers an event. โ—‰ Event handler Answer: Code that executes based on a specific event โ—‰ Where is the script element placed in HTML doc? Answer: anywhere โ—‰ Defer Answer: script can be loaded asynchronously but will wait to execute until the HTML parsing is complete โ—‰ Async Answer: lets the JavaScript engine know that you are declaring an asynchronous function

โ—‰ How can you make the browser not parse and load an external script file until after the page has loaded? Answer: defer attribute โ—‰ When should you use an external JavaScript file instead of embedding your JavaScript code within the HTML file? Answer: larger projects for better performance, maintainability, and organization โ—‰ function Answer: related group of JavaScript statements executed as a single unit โ—‰ how to execute a function Answer: invoke/call it from elsewhere in the program โ—‰ what does the scope of a variable determine Answer: where it can be referenced โ—‰ scope of variables declared with let Answer: block scoped - can be referenced only within their command block

โ—‰ scope of variables declared with var Answer: function scoped - can be referenced only within their function โ—‰ Global variable Answer: can be referenced anywhere within the program โ—‰ Local variable Answer: can only be referenced within its command block or function โ—‰ data type Answer: specific category of information that a variable โ—‰ loosely typed programming language Answer: does not require you to declare data types of variables โ—‰ JavaScript escape character () Answer: tells compilers and interpreters that the character that follows has special purpose โ—‰ Operators

โ—‰ operator precedence Answer: the order in which operations in an expression are evaluated โ—‰ Anonymous functions Answer: unnamed functions โ—‰ primitive data type Answer: data that is not an object and has no methods or properties (ex. boolean) โ—‰ One advantage of event listeners over event handlers Answer: multiple functions can be attached to the same event on a single element โ—‰ prefix operator Answer: when operator comes before the variable (ex. ++a) โ—‰ postfix operator Answer: when operator comes after the variable (ex. a++)

โ—‰ array Answer: contains a set of data represented by a single variable name โ—‰ element Answer: each piece of data contained in an array โ—‰ index Answer: an elements numeric position within the array โ—‰ loop statement Answer: control flow statement that repeatedly executes a statement or a serious of statements while a specific condition is true/until specific condition becomes true โ—‰ While statement Answer: used for repeating statement or series of statements as long as a given conditional expression evaluates to true โ—‰ iteration Answer: each repetition of a looping statement โ—‰ infinite loop

Answer: used to execute specific programming code if the evaluation of a conditional expression returns a value of true โ—‰ nested decision making structure Answer: when one decision making statement is contained within another decision making statement โ—‰ switch statement Answer: controls program flow by executing a specific set of statements, depending on the value of an expression โ—‰ break statement Answer: used to exit control statements โ—‰ pretest loop Answer: program loops where stopping condition is evaluated before each iteration โ—‰ posttest loops Answer: program loops where stopping condition is evaluated after each iteration

โ—‰ A simple if else statement enables you to specify code for blank _______ alternatives Answer: 2 โ—‰ To insert HTML code within an element without overwriting code already in that element, use the blank 1 method Answer: insertAdjacentHTML() โ—‰ Syntax errors Answer: occur when the interpreter fails to recognize code โ—‰ Runtime errors Answer: occur when the JavaScript interpreter encounters a problem while a program is executing โ—‰ Logic errors Answer: flaws in a program's design that prevent the program from running as you anticipate โ—‰ first line of defense in locating bugs in JavaScript programs Answer: consists of error messages received when JavaScript interpreter encounters errors

โ—‰ step in (or into), step over, and step out Answer: options in browser debugging tools allowing you to continue program execution after you enter break mode โ—‰ You can add an expression to the watch list in browser debugging tools to monitor its value as you step through the program Answer: True โ—‰ call stack Answer: refers to the order in which procedures execute in a program โ—‰ bulletproofing Answer: writing code that anticipates and handles potential problems โ—‰ exception handling Answer: allows programs to handle errors as they occur in the execution of a program โ—‰ exception Answer: refers to some type of error that occurs in a program

โ—‰ You can assign a custom function to JavaScript's error event for handling any types of errors that occur on a web page Answer: true โ—‰ Methods for locating and correcting errors Answer: checking your HTML elements, analyzing your logic, testing statements with the console command line, using the debugger statement, executing code in strict mode, linting, and reloading a web page โ—‰ Bubbling phase Answer: Final phase - The event bubbles up from the target element โ—‰ Capturing phase Answer: First phase - The event moves down towards the target element โ—‰ Target phase Answer: Second phase - The event reaches the target element