Web Fundamentals
Abbreviations
*[CSS]: Cascading Style Sheet
*[HTML]: Hypertext Markup Language
*[js]: JavaScript
Introduction
The software engineering techniques we’ll teach you in this course build on web fundamentals like HTML, CSS, and JavaScript. We want to make sure you understand the basics of these languages before we get into more advanced techniques. Depending on your knowledge level, this unit could be mostly reviewed. Every page on the internet uses some combination of HTML, CSS, and JavaScript—so once you learn how to use these languages effectively, the possibilities are endless. Employers will want you to have knowledge of these languages—daily work will use these skills.
After that, we'll teach you about how to use Chrome's Developer Tools to debug your code. Debugging skills are arguably the most important part of being an engineer.
This unit will also look at a JavaScript function called timers. This is a function that allows you to call a second function after a set amount of time elapsed. For instance, if you wanted to create a pop-up to collect the emails of visitors to your web page, a timer would be an easy way to schedule that.
Goals
Review and expand on the web development fundamentals you'll need to succeed in any full-stack career
Learn how to use Chrome's native debugger to find and fix problems in your code
Learn about how timers work in JavaScript
Web Fundamentals Refresher
Web Review
In this subunit, we'll be reviewing the fundamentals of web development to give you good base knowledge to build upon.
Every page on the internet uses HTML for its content, text, and images, CSS for visual styling, and JavaScript for interactive elements. Before we move further in this course, it is important you know how to use these languages. They are present everywhere in our online life. Every type of aspiring programmer must understand how these languages work and interact.
Subunit Goals
Review essential topics in HTML and CSS
Review essential topics in JavaScript
HTML Must Know
you should be familiar with the following HTML elements
Essential HTML elements
You should be able to explain block elements vs inline elements
HTML list elements
What is the difference between an ul
and an ol
tag?
Know these additional HTML elements:
what is the
script
tag used for?what is the difference between a
link
tag and ana
tag?why is it important to include an
alt
attribute inside animg
tag?understand the main elements of an HTML table:
HTML forms
understand how to connect a label to an input tag using the
for
attributeunderstand the most common input tag attributes
type
name
placeholder
value
CSS Must Know
CSS specificity
what is the specificity of our selectors important?
in the following code, what color will the background of the
h1
tag be?
CSS selectors
know when to use a class selector and when to use id selector
what is wrong with the following code?
CSS properties
you should be comfortable controlling the space between html elements
understand the difference between padding and margin
understand how to control the amount of margin and padding:
top
right
bottom
left
CSS shorthand properties
be able to apply shorthand properties to the following property types:
margin
padding
border
CSS positioning
Understand how to position elements using the following property types:
static
fixed
relative
absolute
JavaScript Must Know
Declaring variables
You do not have to know all the details of var, let, and const. However, you should be familiar with these concepts:
Keyword | Can Reassign | Can Redeclare | Scope Rules |
---|---|---|---|
var | yes | yes | function |
let | yes | no | block |
const | no | no | block |
We will be using let and const primarily. You'll dive into the difference later in the course.
Conditional logic
you should understand the differences between:
if
else if
else
You should understand 'js expressions' are always converted to a boolean value when passed to a control statement
You should be able to explain the difference between the following two snippets of code
Logical operators
You should have an understanding of the logical operators:
|| (OR)
&& (AND)
! (NOT)
Primitive data types
You should be familiar with the following five primitive data types:
Numbers
Strings
Booleans
Undefined
Null
Numbers
You should be comfortable with:
converting a number to a string
generating a random number
Rounding a number with the following functions:
Math.round()
Math.ceil()
Math.floor()
Strings
You should be comfortable with:
Creating a string
Converting a string to a number
Iterating through each element in a string
Making a copy of a string
Booleans
You should know the difference between a 'truthy' and 'falsy' value
Know the following six 'falsy' values in JavaScript
undefined`
0
""
false
null
NaN
Know two approaches for converting an expression to 'truthy' or 'falsy'
Boolean(<expression>)
!!<expression>
Iteration
You should be very comfortable with the syntax for iterating through a string or an array using a 'for loop'
You should understand the syntax for iterating through a string or an array using a 'while loop'
You should understand the difference between a 'for...of' and 'for...in' loop
You should be comfortable writing a nested for loop
For example, how would you print each element in the following array of subarrays?
Arrays
You should be comfortable with:
creating an array
getting and setting elements in an array
iterating through arrays
making copies of arrays
Objects
You should be comfortable with:
creating objects
getting and setting key value pairs
iterating through objects
making copies of objects
You should know the difference between dot and bracket notation
You should understand the subtle differences between the following code samples:
dot notation uses literal arg string as a key
bracket notation allows you to pass arguments dynamically
Arrays and objects
you should understand what the following code will do and why:
Here we are comparing if the array is the same actual array not the values held in the array
The same result happens when comparing objects
Functions
you should know the syntax for creating functions with and without parameters
understand how to return values from a function
how to invoke functions with and without arguments
function scope vs global scope
placing functions on objects (methods)