Javascript Flashcards
(257 cards)
What is the HTML format
<html><head>
</head>
<body> ...
<main>
</main>
</body>
</html>
is it a group practise to declare variables before you used them
True
Can the console change objects in the HTML browser
True
what do you use to create comments in JS
// for asingle line,
/*
*/ for paragraphs
What is short cut for commenting out a line of code for debugging purposes
Place the cursor on a line and type crtl /
What is short cut for commenting out multiple lines of code for debugging purposes
highlight the lines and type ctrl /
what characters is added to the end of lines of code
;
What does it mean when we say JavaScript is an “object-oriented” language?
JavaScript is modeled around objects with properties and methods which can be handled in a modular fashion.
What happens to the website and the code when you write code in the browser console?
Code in the browser console impacts the current browser instance only. It exists in the console for as long as the window is open.
What is an indicator of someone being a good JavaScript developer?
They follow standards, invest in learning, use formatting and linting tools for consistency, and write accessible code.
What is the natural environment for JavaScript?
The browser, server environments, and your computer.
What is ECMAScript?
The specification describing how browsers should implement and interpret JavaScript.
Where should you develop and test your JavaScript code?
Develop in a code editor, test in as many browsers as you can get your hands on.
Why have command line and automation tools become popular in JavaScript development?
They simplify complex processes and introduce features to help developers write better code.
How do you indicate to the browser that a section of a program is JS
Is it a good practice to place JS code at the end of a doc
False
What is antipattern
Loading JS at the footer
What is JS modules
Pieces of code save in files and importing/exporting them when they are needed. The code is saved under Script.JS file.
When does the browser execute JavaScript?
By default: When the script is encountered. If the script is set to “async”, when the script is fully loaded. If the script is set to “defer”, when the entire HTML page is rendered.
What happens when you defer JavaScript?
The browser loads the JavaScript asynchronously when it is encountered, then waits until all HTML is rendered before executing the script.
JavaScript modules are heavily used in frameworks like React and Vue. What is the advantage of using modules?
Modules enable modularization of code where individual functions, components, data objects, and other parts can be separated into individual files.
What is the correct markup for adding an external JavaScript file to an HTML document?
what do properties do in JS
Describe objects
What are methods
Properties changing features inside objects
color = "pink", propLength = 4, use = false };