Loading...
More JavaScript Posts
// Orconst randomColor = () => `#${(~~(Math.random()*(1<<24))).toString(16)}`;console.log(randomColor);
const gcd = (...arr) => {const _gcd = (x, y) => (!y ? x : gcd(y, x % y));return [...arr].reduce((a, b) => _gcd(a, b));};gcd(8, 36); // 4gcd(...[12, 8, 32]); // 4
console.log("hello world")
import React, { useState } from 'react' import Welcome from '../components/Welcome' function About() { const [showWelcome, setShowWelcome] = useState(false) return ( <div> {showWelcome ? <Welcome /> : null} </div> <div> {showWelcome && <Welcome /> } </div> ) } export default App
// Get the text that the user has selectedconst getSelectedText = () => window.getSelection().toString();getSelectedText();
alert("bruh")