Skip to content

Instantly share code, notes, and snippets.

@ross-u
ross-u / README.md
Created October 25, 2019 13:36
JS | Object Oriented Intro - Part 2 - prototypes and keyword `new`

JS | Object Oriented Intro - Part 2 - prototypes and keyword new

Object-oriented programming (OOP) is a programming paradigm (model/standard) based on the concept of “objects”, which can contain data, in the form of attributes / properties ), and code in the form of functions/procedures ( known as methods).

Objects are the main key/tool/means of OOP. We will try to explain this through example.

@ross-u
ross-u / README.md
Created October 26, 2019 13:58 — forked from joyrexus/README.md
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

@ross-u
ross-u / README.md
Last active October 28, 2019 08:29
LAB SOLUTION - javascript-all-time-movies
@ross-u
ross-u / README.md
Last active January 18, 2021 16:15
JS | Value vs Reference

JS | Value vs Reference - Lecture Notes


There are 8 basic data types in JavaScript. Primitive data types are String, Number, Boolean, null, undefined, Symbol, BigInt. Everything else is an Object type.


@ross-u
ross-u / README.md
Last active May 13, 2021 10:24
Function for deep copying objects and arrays - cloneObject()

Function for deep copying objects and arrays - cloneObject()


@ross-u
ross-u / README.md
Last active November 10, 2019 20:15
DOM | DOM Manipulation Lecture - Code Along

DOM | DOM Manipulation Lecture - Code Along


Files:

index.html

style.css

@ross-u
ross-u / README.md
Last active November 17, 2020 15:22
JS | Asynchronous JS and callbacks

JS | Asynchronous JS and callbacks


Console Clock - example

@ross-u
ross-u / README.md
Last active April 28, 2023 09:52
LAB SOLUTION - Chronometer

LAB SOLUTION - Chronometer

@ross-u
ross-u / README.md
Created October 30, 2019 11:57
LAB SOLUTION - DOM | Ironhack Cart

LAB SOLUTION - DOM | The Ironhack Cart

@ross-u
ross-u / index.js
Last active May 13, 2021 10:22
Using localStorage - example
// An array that contains data (array of objects)
// to be stored in the localStorage
const score = [
{ name: 'Anna', score: 4120 },
{ name: 'Bob', score: 1245 },
{ name: 'Sarah', score: 5699 },
{ name: 'Marc', score: 3452 },
];