What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-22 12:09:57
arrow functions basic usages in javascript
// An empty arrow function returns undefined let empty = () => {}; (() => 'foobar')(); // Returns "foobar" // (this is an Immediately Invoked Function Expression) var simple = a => a > 15 ? 15 : a; simple(16); // 15 simple(10); // ... Add solution -
Other 2021-11-22 12:09:56
arrow functions basic usages in javascript
// An empty arrow function returns undefined let empty = () => {}; (() => 'foobar')(); // Returns "foobar" // (this is an Immediately Invoked Function Expression) var simple = a => a > 15 ? 15 : a; simple(16); // 15 simple(10); // ... Add solution -
Javascript 2021-11-04 12:28:10
onclick hold react
import { useState, useEffect, useCallback } from 'react'; export default function useLongPress(callback = () => {}, ms = 300) { const [startLongPress, setStartLongPress] = useState(false); useEffect(() => { let timerId; if (startLongPr... Add solution