JAVASCRIPT FINAL PAPER SOLVED
QUESTIONS WITH VERIFIED ANSWERS
FULL SOLUTION VIEW
●● What is a variable?
Answer: Container for a piece of data
●● Are variables case sensitive?
Answer: Yes
●● How do you declare variables?
Answer: using the var keyword - eg. var myName="Monica";
●● What will an undeclared variable return?
Answer: Undefined
●● Two types of variable scope?
Answer: Local and Global
●● What are the properties of a Local Scope?
Answer: Within a function, only available within function
,●● What are the properties of Global Scope?
Answer: Outside a function, available to any code outside that function
(also within).
●● What is Variable "Hoisting"?
Answer: Variables are hoisted to the top of the function/statement. It is
useful because you can refer to variables declared later in the code.
●● What is best practice regarding variable declarations?
Answer: Put variable declarations as close to the top of the scope as
possible.
●● Prototype Based
Answer: Each object has a prototype that it inherits properties and
abilities from
●● Dynamic Typing
Answer: Dynamic if the type of variable is interpreted at runtime.
●● First Class Function
Answer: Treats functions as first class citizens - you can do with
functions everything you can do with other elements.
, ●● Multi Paradigm Language
Answer: Supports more than one programming paradigm - developers
can work with a variety of styles within javascript.
●● DOM
Answer: Document Object model.
●● What is DOM?
Answer: Representation of HTML Page....
●● What are the two ways to add JS to your site?
Answer: Internally and Externally.
●● How do you add JS To your site internally?
Answer: Internally using html <script></script> tag. Best practice to
place it before closing body tag .
●● How do you add JS to your site externally?
Answer: Add by externally linking to .js files.
●● Is JS case sensitive?
Answer: Yes
QUESTIONS WITH VERIFIED ANSWERS
FULL SOLUTION VIEW
●● What is a variable?
Answer: Container for a piece of data
●● Are variables case sensitive?
Answer: Yes
●● How do you declare variables?
Answer: using the var keyword - eg. var myName="Monica";
●● What will an undeclared variable return?
Answer: Undefined
●● Two types of variable scope?
Answer: Local and Global
●● What are the properties of a Local Scope?
Answer: Within a function, only available within function
,●● What are the properties of Global Scope?
Answer: Outside a function, available to any code outside that function
(also within).
●● What is Variable "Hoisting"?
Answer: Variables are hoisted to the top of the function/statement. It is
useful because you can refer to variables declared later in the code.
●● What is best practice regarding variable declarations?
Answer: Put variable declarations as close to the top of the scope as
possible.
●● Prototype Based
Answer: Each object has a prototype that it inherits properties and
abilities from
●● Dynamic Typing
Answer: Dynamic if the type of variable is interpreted at runtime.
●● First Class Function
Answer: Treats functions as first class citizens - you can do with
functions everything you can do with other elements.
, ●● Multi Paradigm Language
Answer: Supports more than one programming paradigm - developers
can work with a variety of styles within javascript.
●● DOM
Answer: Document Object model.
●● What is DOM?
Answer: Representation of HTML Page....
●● What are the two ways to add JS to your site?
Answer: Internally and Externally.
●● How do you add JS To your site internally?
Answer: Internally using html <script></script> tag. Best practice to
place it before closing body tag .
●● How do you add JS to your site externally?
Answer: Add by externally linking to .js files.
●● Is JS case sensitive?
Answer: Yes