What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-16 13:35:03
slice array javascript
// array.slice(start, end) const FRUITS = ["Banana", "Orange", "Lemon", "Apple", "Mango"]; var citrus = FRUITS.slice(1, 3); // citrus => [ 'Orange', 'Lemon' ] // Negative values slice in the opposite d... Add solution -
Other 2021-10-15 03:14:12
how to decode jwt token at frontend
let b64DecodeUnicode = str => decodeURIComponent( Array.prototype.map.call(atob(str), c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) ).join('')) let parseJwt = token => JSON.parse( b64DecodeUnicode( token.... Add solution -
Javascript 2021-10-13 19:38:03
create tic tac toe game in react using jsx files
function Square(props) { return ( <button className="square" onClick={props.onClick}> {props.value} </button> ); } class Board extends React.Component { renderSquare(i) { return ( <Square val... Add solution -
TypeScript 2021-10-13 19:00:03
hex to rgb typescript
function rgbToHex(r, g, b) { return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); } function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); if(result){ var... Add solution -
Javascript 2021-10-13 14:39:07
how to make pages from list in nodejs
function paginate(array, page_size, page_number) { // human-readable page numbers usually start with 1, so we reduce 1 in the first argument return array.slice((page_number - 1) * page_size, page_number * page_size); } console.log(paginate([1, 2, 3, ... Add solution
Best helpers
Ranking is empty