Terminology Flashcards

Understand basic coding concepts without searching every time

1
Q

What is a viewport?

A

A viewport represents a polygonal (normally rectangular) area in computer graphics that is currently being viewed. In web browser terms, it refers to the part of the document you’re viewing which is currently visible in its window (or the screen, if the document is being viewed in full screen mode). Content outside the viewport is not visible onscreen until scrolled into view.

The portion of the viewport that is currently visible is called the visual viewport. This can be smaller than the layout viewport, such as when the user has pinched-zoomed. The layout viewport remains the same, but the visual viewport became smaller.

https://developer.mozilla.org/en-US/docs/Glossary/Viewport

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does using media queries do in CSS?

A

Media queries allow you to apply CSS styles depending on a device’s media type (such as print vs. screen) or other features or characteristics such as screen resolution or orientation, aspect ratio, browser viewport width or height, user preferences such as preferring reduced motion, data usage, or transparency.

Media queries are used for the following:

  • To conditionally apply styles with the CSS @media and @import at-rules.
  • To target specific media for the <style>, <link></link>, <source></source>, and other HTML elements with the media= or sizes=" attributes.</style>
  • To test and monitor media states using the Window.matchMedia() and EventTarget.addEventListener() methods.

Syntax-a media query is composed of an optional media type and any number of media feature expressions, which may optionally be combined in various ways using logical operators. Media queries are case-insensitive.

Media types define the broad category of device for which the media query applies: all, print, screen. The type is optional (assumed to be all) except when using the not or only logical operators.
Media features describe a specific characteristic of the user agent, output device, or environment:
any-hover
any-pointer

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is RWD?

A

RWD is Responsive Web Design is NOT a separate technology…it’s an approach.

Responsive web design (RWD) is a web design approach to make web pages render well on all screen sizes and resolutions while ensuring good usability. It is the way to design for a multi-device web. In this article, we’ll help you understand some techniques that can be used to master it.

The difference is mainly to do with the devices involved, and the technologies available to create solutions:

We used to talk about desktop or mobile, but now there are many different types of device available such as desktop, laptop, mobile, tablets, watches, etc. Instead of catering for a few different screen sizes, we now need to design sites defensively to cater for common screen sizes and resolutions, plus unknowns.
Mobile devices used to be low-powered in terms of CPU/GPU and available bandwidth. Some didn’t support CSS or even HTML, and as a result, it was common to perform server-side browser sniffing to determine device/browser type before then serving a site that the device would be able to cope with. Mobile devices often had really simple, basic experiences served to them because it was all they could handle. These days, mobile devices are able to handle the same technologies as desktop computers, so such techniques are less common.

You should still use the techniques discussed in this article to serve mobile users a suitable experience, as there are still constraints such as battery life and bandwidth to worry about.

User experience is also a concern. A mobile user of a travel site might just want to check flight times and delay information, for example, and not be presented with a 3D animated globe showing flight paths and your company history. This can be handled using responsive design techniques, however. (YES!)

Modern technologies are much better for creating responsive experiences. For example, responsive images/media technologies now allow appropriate media to be served to different devices without having to rely on techniques like server-side sniffing.

https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Responsive_Design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does CSS stand for?

A

CSS stands for Cascading Style Sheets, and that first word cascading is incredibly important to understand — the way that the cascade behaves is key to understanding CSS.

Conflicts of CSS article: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is inheritance in CSS?

A

The significant here is the concept of inheritance, which means that some CSS properties by default inherit values set on the current element’s parent element and some don’t. This can also cause some behavior that you might not expect.

https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a CSS pseudo-element?

A

A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s).

https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

Syntax:
selector::pseudo-element {
property: value;
}

CSS
/* The first line of every <p> element. */
p::first-line {
color: blue;
text-transform: uppercase;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a CSS pseudo-class?

A

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, the pseudo-class :hover can be used to select a button when a user’s pointer hovers over the button and this selected button can then be styled.

https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a CSS transition property?

A

The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, transition-delay, and transition-behavior.

https://developer.mozilla.org/en-US/docs/Web/CSS/transition

Constituent properties
This property is a shorthand for the following

CSS properties:
transition-behavior Experimental
transition-delay
transition-duration
transition-property
transition-timing-function

SYNTAX
/* Apply to 1 property /
/
property name | duration */
transition: margin-right 4s;

/* property name | duration | delay */
transition: margin-right 4s 1s;

/* property name | duration | easing function */
transition: margin-right 4s ease-in-out;

/* property name | duration | easing function | delay */
transition: margin-right 4s ease-in-out 1s;

/* property name | duration | behavior */
transition: display 4s allow-discrete;

/* Apply to 2 properties */
transition:
margin-right 4s,
color 1s;

/* Apply to all changed properties */
transition: all 0.5s ease-out allow-discrete;
transition: 200ms linear 50ms;

/* Global values */
transition: inherit;
transition: initial;
transition: revert;
transition: revert-layer;
transition: unset;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Typography in CSS?

A

Overview: Styling text

In this article we’ll start you on your journey towards mastering text styling with CSS. Here we’ll go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.

Prerequisites: HTML basics (study Introduction to HTML), CSS basics (study Introduction to CSS).
Objective: To learn the fundamental properties and techniques needed to style text on web pages.

What is involved in styling text in CSS?
Text inside an element is laid out inside the element’s content box. It starts at the top left of the content area (or the top right, in the case of RTL language content), and flows towards the end of the line. Once it reaches the end, it goes down to the next line and flows to the end again. This pattern repeats until all the content has been placed in the box. Text content effectively behaves like a series of inline elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line break manually using the <br></br> element.

Note: If the above paragraph leaves you feeling confused, then no matter — go back and review our Box model article to brush up on the box model theory before carrying on.

The CSS properties used to style text generally fall into two categories, which we’ll look at separately in this article:

Font styles: Properties that affect a text’s font, e.g., which font gets applied, its size, and whether it’s bold, italic, etc.

Text layout styles: Properties that affect the spacing and other layout features of the text, allowing manipulation of, for example, the space between lines and letters, and how the text is aligned within the content box.

https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is CSS custom properties (variables) used for?

A

Custom properties (sometimes referred to as CSS variables or cascading variables) are entities defined by CSS authors that represent specific values to be reused throughout a document. They are set using the @property at-rule or by custom property syntax (e.g., –primary-color: blue;). Custom properties are accessed using the CSS var() function (e.g., color: var(–primary-color);).

Complex websites have very large amounts of CSS, and this often results in a lot of repeated CSS values. For example, it’s common to see the same color used in hundreds of different places in stylesheets. Changing a color that’s been duplicated in many places requires a search and replace across all rules and CSS files. Custom properties allow a value to be defined in one place, then referenced in multiple other places so that it’s easier to work with. Another benefit is readability and semantics. For example, –main-text-color is easier to understand than the hexadecimal color #00ff00, especially if the color is used in different contexts.

Custom properties defined using two dashes (–) are subject to the cascade and inherit their value from their parent. The @property at-rule allows more control over the custom property and lets you specify whether it inherits its value from a parent, what the initial value is, and the type constraints that should apply.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do I create fancy boxes in CSS?

A

CSS boxes are the building blocks of any web page styled with CSS. Making them nice looking is both fun and challenging. It’s fun because it’s all about turning a design idea into working code; it’s challenging because of the constraints of CSS. Let’s do some fancy boxes.

Before we start getting into the practical side of it, make sure you are familiar with the CSS box model. It’s also a good idea, but not a prerequisite, to be familiar with some CSS layout basics.

On the technical side, Creating fancy boxes are all about mastering CSS border and background properties and how to apply them to a given box. But beyond the techniques it’s also all about unleashing your creativity. It will not be done in one day, and some web developers spend their whole life having fun with it.

https://developer.mozilla.org/en-US/docs/Learn/CSS/Howto/create_fancy_boxes

HTML

<div>Hi! I want to be fancy.</div>

Ok, that’s a very small bit of HTML, what can we tweak on that element? All the following:

Its box model properties: width, height, padding, border, etc.
Its background properties: background, background-color, background-image, background-position, background-size, etc.
Its pseudo-element: ::before and ::after
and some aside properties like: box-shadow, rotate, outline, etc.
So we have a very large playground. Let the fun begin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In CSS. what is a Combinators?

A

Overview: Building blocks

The final selectors we will look at are called combinators, because they combine other selectors in a way that gives them a useful relationship to each other and the location of content in the document.

Prerequisites: Basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.)
Objective: To learn about the different combinator selectors that can be used in CSS.
Descendant combinator
The descendant combinator — typically represented by a single space (“ “) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent’s parent, parent’s parent’s parent, etc.) element matching the first selector. Selectors that utilize a descendant combinator are called descendant selectors.

https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Combinators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a website wireframe?

A

A website wireframe, also known as a page schematic or screen blueprint, is a visual guide that represents the skeletal framework of a website.[1]: 166  The term wireframe is taken from other fields that use a skeletal framework to represent 3 dimensional shape and volume.[2] Wireframes are created for the purpose of arranging elements to best accomplish a particular purpose. The purpose is usually driven by a business objective and a creative idea. The wireframe depicts the page layout or arrangement of the website’s content, including interface elements and navigational systems, and how they work together.[3]: 131  The wireframe usually lacks typographic style, color, or graphics, since the main focus lies in functionality, behavior, and priority of content.[1]: 167  In other words, it focuses on what a screen does, not what it looks like.[1]: 168  Wireframes can be pencil drawings or sketches on a whiteboard, or they can be produced by means of a broad array of free or commercial software applications. Wireframes are generally created by business analysts, user experience designers, developers, visual designers, and by those with expertise in interaction design, information architecture and user research.

Wireframes focus on:

The range of functions available
The relative priorities of the information and functions
The rules for displaying certain kinds of information
The effect of different scenarios on the display[1]: 169 
The website wireframe connects the underlying conceptual structure, or information architecture, to the surface, or visual design of the website.[3]: 131  Wireframes help establish functionality and the relationships between different screen templates of a website. An iterative process, creating wireframes is an effective way to make rapid prototypes of pages, while measuring the practicality of a design concept. Wireframing typically begins between “high-level structural work—like flowcharts or site maps—and screen designs.”[1]: 167  Within the process of building a website, wireframing is where thinking becomes tangible.[4]: 186 

Wireframes are also utilized for the prototyping of mobile sites, computer applications, or other screen-based products that involve human-computer interaction.[2]

https://en.wikipedia.org/wiki/Website_wireframe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Does JavaScript go from left to right or top to bottom?

A

Top to bottom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a statement?

A

An action to be carried out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a string in JavaScript?

A

It is a sequence of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does ;; do in JavaScript?

A

Loops forever since it’s conditions are empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Does return work in both a loop and a function?

A

No, “return” only works inside a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Does “break” and “continue” work inside a loop and a function?

A

No, “break” and “continue” only work inside a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a function?

A

A function is a chunk of code that can be repeated multiple times

21
Q

When you define a function, does it have access to any variables that you defined in its scope?

A

Yes, it has access because it was defined then the function was defined. That’s not how other languages work (C++, Python, PhP, etc).

22
Q

What is an empty argument?

printHello();

A

There is no arguments and no parameters.

23
Q

Can a function return any values?

A

Yes, it can return two values. It can send a value or step over.

24
Q

Can you return anything?

A

Yes, string, number, Boolean, object, any valid value you can return

25
Q

In JavaScript, what is a method? What kind of Function?

A

Anonymous function

26
Q

What is Syntax in coding?

A

Syntax refers to the rules that define the structure of a language. Syntax in computer programming means the rules that control the structure of the symbols, punctuation, and words of a programming language.

Without syntax, the meaning or semantics of a language is nearly impossible to understand.

For example, a series of English words, such as — subject a need and does sentence a verb — has little meaning without syntax.

Applying basic syntax results in the sentence — Does a sentence need a subject and verb?

27
Q

Can you put a key on an anonymous function or a method?

A

Yes, you can put an anonymous functions as the value on a key on the object. This is the only place that function will be available once outside that closure, it doesn’t exist.

It’s not recommended to put functions inside of functions, but anonymous functions are okay. And we don’t want to come up with a name.

28
Q

In this how do you designate a and b and which should come first?

list.sort(function(a, b) {

});

A

you do
-1 for a if should come first
1 for b if should come first
0 if it doesn’t matter

29
Q

What is an array?

A

dynamic list of things (objects, functions, anything)

30
Q

If you want to get a value out of an array, what do you need to do?

A

Index data from the array

Array starts at “0” (arrays are indexed by 0 not 1)

31
Q

Why do arrays start at zero?

A

Martin Richards, creator of the BCPL language (a precursor of C), designed arrays initiating at 0 as the natural position to start accessing the array contents in the language, since the value of a pointer p used as an address accesses the position p + 0 in memory.

32
Q

Loops and Arrays go together nicely, why?

A

Because arrays have a property called length

console.log(names.length);

length does not start at zero, starts at 1

33
Q

Arrays have a “push” function, what does that do?

A

Let’s us add a new element onto the current array. (you can do strings, numbers, you can do variables, etc.)

34
Q

There are four functions for adding and removing elements from the array, what are they?

A

“Push” function basically puts it onto the end of the array

example:
var newName = “Rob”;
names.push(newName);

“Unshift” function if you want to add to the front of the array

example:
var names.unshift(“Rose”);

“pop” function for removing something from an array, and pop actually returns what was removed, pop removes it from the end

example:
var removeName = names.pop();

“shift” function to remove something from the beginning

example:
var removedName = names.shift();

“splice” if you want to remove or add something specific

example:
removedName = names.splice(2, 1,)
removedName = names.splice(index, number,)

give it the index which is 2
give it the number you want it to remove

it returns what you removed and reprints the array just in case it removed something else you can see it fully

You can remove AND insert elements in splice.

splice(start: number, deleteCount?: number); string []

names.splice(3, 0, “Thomas)

3 is where do they start
0 is what needs to be deleted
“Thomas” is what needs to be added in place of 3

35
Q

Are arrays created with square brackets [ ] ?

A

Yes

36
Q

Each value/element in the array initialize or added by a comma, no comma on the last one

A

Looks like:

var names - [
“Bob”,
“Sabrina”,
“Billy”
}

37
Q

How do you loop over them?

A

for (var i=0; i<names.length;i++)
var name = names[1];
console.log(name);

38
Q

What does JavaScript execute first in this example? what is to the left of the equals sign or what is to the right of the equals sign?

const greetingFunction = getGreeting);

A

JavaScript executes what is to the right first, then what is to the left.

39
Q

What does ++ mean in JavaScript?

A

It means post increment to the nexts, adds one

40
Q

What is JavaScript?

A

JavaScript is a single threaded call stack, can run one thing at a time.

41
Q

What is a call stack?

A

It’s a data structure which records basically where in the program we are.

42
Q

What does blowing the stack mean?

A

function going on over and over with nothing to stop it

43
Q

Blocking

A

Code that is slow

44
Q

What is an asynchronous callbacks?

A

?

45
Q

What does “querySelector” return?

A

Returns one item, the first item only (using CSS selectors)

46
Q

What does “querySelectorAll” return?

A

Return a list (using CSS selectors)

47
Q

Does createElement and appendChild go together? Can you run them separately?

A

No! They must go together. Create and append, create and append, create and append.

48
Q

What writing JavaScript, is var only used to create the variable? Do I need to write var each time I use the variable I create?

A

Only use it to create the container, var is only used when you are constructing a new variable, When you decide to use or change the variable, you only need to use the variable name.

49
Q

what is a guard in Javascript?

A

it guards or checks some condition to make sure condition is met, protects the code from bad values (that might cause a catastrophic failure in your code)