What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-12 10:45:13
javascript remove last character in a string
str=str.slice(0, -1); Add solution -
-
Javascript 2022-03-11 20:00:13
hex to rgba in js
hexToRGB(hex: string, alpha: string) { const r = parseInt(hex.slice(1, 3), 16); const g = parseInt(hex.slice(3, 5), 16); const b = parseInt(hex.slice(5, 7), 16); if (alpha) { return `rgba(${r}, ${g}, ${b}, ${alpha})`; } else { return `... Add solution -
Javascript 2022-03-11 19:40:08
react load more listview
import { useState, useEffect, useCallback } from 'react' export const LoadMoreItem = (props) => { const [increment, setIncrement] = useState(4) const [disabled, setDisabled] = useState(false) const [hidden, setHidden] = useState(false) useEffect(... Add solution -
Javascript 2022-02-28 11:05:09
get last element of array javascript
// Method - 1 ([] operator) const arr = [5, 3, 2, 7, 8]; const last = arr[arr.length - 1]; console.log(last); /* Output: 8 */ // Method - 2 (Destructuring Assignment) const arr = [5, 3, 2, 7, 8]; const [last] = arr.slice(-1); console.log(last); /* ... Add solution
Best helpers
Ranking is empty