生成一個長度為 11 的随機字母字元串
Math.random().toString(36).substring(2);
生成一個随機十六進制代碼,如 #c618b2
#c618b2
'#' + Math.floor(Math.random() * 0xffffff).toString(16).padEnd(6, '0');
Math.random().toString(36).substring(2);
#c618b2
'#' + Math.floor(Math.random() * 0xffffff).toString(16).padEnd(6, '0');