This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const users = [ | |
{ | |
name: "Jane", | |
balance: 100, | |
}, | |
{ | |
name: "John", | |
balance: 75, | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const users = [ | |
{ | |
name: "Jane", | |
balance: 100, | |
}, | |
{ | |
name: "John", | |
balance: 75, | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const users = [ | |
{ | |
name: "Jane", | |
balance: 100.00 | |
}, | |
{ | |
name: "John", | |
balance: 55.25 | |
} | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elements = [1, 2, 3, 4, 5]; | |
const indexToRemove = 2; // starts from 0, so it targets the third element | |
const nextElements = [ | |
...elements.slice(0, indexToRemove), | |
...elements.slice(indexToRemove + 1) | |
]; // [1, 2, 4, 5] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elements = [1, 2, 3, 4, 5]; | |
// remove last element | |
const lastElementRemoved = elements.slice(0, 4); // [1, 2, 3, 4] | |
// remove first element | |
const firstElementRemoved = elements.slice(1); // [2, 3, 4, 5] | |
// remove first and last element (chaining) | |
const firstAndLastElementRemoved = elements.slice(0, 4).slice(1) // [2, 3, 4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elements = [1, 2, 3, 4]; | |
const appendedElements = [...elements, 5]; // [1, 2, 3, 4, 5] | |
const prependedElements = [0, ...appendedElements]; // [0, 1, 2, 3, 4, 5] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
} from 'react-native'; | |
import Modal from "react-native-modal"; | |
const styles = StyleSheet.create({ | |
modal: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
TouchableOpacity, | |
View, | |
Text, | |
} from 'react-native'; | |
import { useDeleteModal } from "./DeleteModal"; | |
const styles = StyleSheet.create({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Middleware that allow to dispatch an array of actions, resulting in a single render | |
* @param next | |
* @returns {Function} | |
*/ | |
export default function reduxBatchMiddleware(next: any) { | |
let nextListeners: any = []; | |
let currentListeners: any; | |
function ensureCanMutateNextListeners() { |