Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript generate random Hex

const randomHex = () => `#${Math.floor(Math.random() * 0xffffff).toString(16).padEnd(6, "0")}`;

console.log(randomHex());
// Result: #92b008
Comment

random hexadecimal character js

const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');

console.log(genRanHex(6));
console.log(genRanHex(12));
console.log(genRanHex(3));
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove all classes jquery 
Javascript :: react-native-paper resize switch resize 
Javascript :: codeigniter 3 return json response 
Javascript :: first x characters of string javascript 
Javascript :: dm someone by id discord.js 
Javascript :: scroll back to top on every transition in react 
Javascript :: node js check if a user exists in mysql 
Javascript :: jquery enable textbox 
Javascript :: find the key of a value in array js 
Javascript :: react native text truncate 
Javascript :: get json by id 
Javascript :: time difference in minutes in JS 
Javascript :: how to push a file to github 
Javascript :: timestamp js 
Javascript :: onclick string 
Javascript :: moment + 1 day 
Javascript :: javascript add required to input 
Javascript :: how to simulate a keypress in javascript 
Javascript :: refresh a page in jquery 
Javascript :: js clamp 
Javascript :: redirect javascript code 
Javascript :: convert moment date to utc format moment 
Javascript :: javascript MAX INT and MIN INT 
Javascript :: how to check if a tag has any chidren 
Javascript :: select tag event listener 
Javascript :: js when key is pressed 
Javascript :: match any character across multiple line regex 
Javascript :: check if not checked vanila js 
Javascript :: add commas to a number javascript 
Javascript :: javascript not empty array not string 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =