What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2021-08-30 10:43:02
simple way to make a text field to accept numbers only with maximum number of length 13 digit and min 10
<input name="phoneNumber" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" type = "number" maxlength = "10" /> Add solution -
Javascript 2021-08-30 03:06:01
array peremutation js recursion
const permutations = arr => { if (arr.length <= 2) return arr.length === 2 ? [arr, [arr[1], arr[0]]] : arr; return arr.reduce( (acc, item, i) => acc.concat( permutations([...arr.slice(0, i), ...arr.slice(i + 1)]).map(val =&g... Add solution -
Other 2021-08-29 21:56:02
how to decode jwt token client side
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