Useful Function in JavaScript

Information shown on this page I’ve notice I use a lot.

ABC

You can start with abcdefghijklmnopqrstuvwxyz or RegExp, or:

function alphabetArray(){ const callBackFunc = (_, i) => String.fromCharCode((i + "a".charCodeAt(0))) return Array.from({length: 26}, callBackFunc); }

function alphabetArray(){ const callBackFunc = (_, i) => String.fromCharCode((i + "a".charCodeAt(0))) return Array.from({length: 26}, callBackFunc); } const abc = alphabetArray().join('') export default function App() { return <h1>{abc}</h1>; }

Calculate the performance of a function

const start = performance.now() const abc = alphabetArray() const end = performance.now() console.log(`${end-start} milliseconds`)