Skip to content

Instantly share code, notes, and snippets.

View nax3t's full-sized avatar

Ian Schoonover nax3t

View GitHub Profile
@nax3t
nax3t / arrayEvery.js
Last active April 12, 2024 22:22
Array every() method in JS
// docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
const phrases = [
"I LOVE PIZZA",
"WHY IS THE SKY BLUE?!",
"WHERE AM I?",
];
function isYelled(phrase) {
return phrase.toUpperCase() === phrase;
}
@nax3t
nax3t / this.md
Created December 1, 2024 11:05
Learn about `this` in Javascript in the context of Call, Apply, Bind, and Arrow Functions

Understanding 'this' and Function Binding in JavaScript

A Beginner's Guide

1. What is 'this'?

Let's start with the most important (and confusing) concept: the this keyword. In JavaScript, this refers to the current execution context - basically, who's running the code right now.

// Example 1: 'this' in a regular object
const person = {
 name: "Alice",