Skip to content

Instantly share code, notes, and snippets.

View felipe-b-oliveira's full-sized avatar
🎯
Focusing

Felipe Oliveira felipe-b-oliveira

🎯
Focusing
View GitHub Profile
@felipe-b-oliveira
felipe-b-oliveira / App.js
Last active August 17, 2023 04:51
error/react-testing-library-toHaveStyle-rgb-hex
import React from "react";
import * as Styles from "./styles";
const App = () => (
<Styles.Wrapper>
<Styles.Title>Hello CodeSandbox</Styles.Title>
</Styles.Wrapper>
);
export default App;
@felipe-b-oliveira
felipe-b-oliveira / array_iteration_thoughts.md
Created March 2, 2023 00:44 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

{"lastUpload":"2021-05-18T18:37:09.844Z","extensionVersion":"v3.4.3"}