Loading...
More JavaScript Posts
let variableSet = JSON.parse('["parent","opener","top","length","frames","closed","location","self","window","document","name","customElements","history","locationbar","menubar","personalbar","scrollbars","statusbar","toolbar","status","frameElement","navigator","origin","external","screen","innerWidth","innerHeight","scrollX","pageXOffset","scrollY","pageYOffset","visualViewport","screenX","screenY","outerWidth","outerHeight","devicePixelRatio","clientInformation","screenLeft","screenTop","defaultStatus","defaultstatus","styleMedia","onsearch",&qu...find","webkitRequestAnimationFrame","webkitCancelAnimationFrame","fetch","btoa","atob","setTimeout","clearTimeout","setInterval","clearInterval","createImageBitmap","close","focus","blur","postMessage","onappinstalled","onbeforeinstallprompt","crypto","indexedDB","webkitStorageInfo","sessionStorage","localStorage","chrome","onpointerrawupdate","speechSynthesis","webkitRequestFileSystem","webkitResolveLocalFileSystemURL","openDatabase","variableSet","TEMPORARY","PERSISTENT","addEventListener","removeEventListener","dispatchEvent"]');let answer = [];for(let v in this) if(!variableSet.includes(v)) answer.push(v);console.log(answer);
const shuffle = ([...arr]) => {let m = arr.length;while (m) {const i = Math.floor(Math.random() * m--);[arr[m], arr[i]] = [arr[i], arr[m]];}return arr;};const foo = [1, 2, 3];shuffle(foo); // [2, 3, 1], foo = [1, 2, 3]
# Acronyms## Computer Numerical Control (CNC)- Typicalldfdfsdffdafdasgfdgfgfdfdafdasfdafda
import { configureStore } from "@reduxjs/toolkit";import { combineReducers } from "redux";import profile from "./profile";import auth from "./auth";import alert from "./alert";const reducer = combineReducers({profile,auth,alert,});const store = configureStore({ reducer });export default store;
var d = new Date();var d = new Date(milliseconds);var d = new Date(dateString);var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
const bucketSort = (arr, size = 5) => {const min = Math.min(...arr);const max = Math.max(...arr);const buckets = Array.from({ length: Math.floor((max - min) / size) + 1 },() => []);arr.forEach(val => {buckets[Math.floor((val - min) / size)].push(val);});return buckets.reduce((acc, b) => [...acc, ...b.sort((a, b) => a - b)], []);};bucketSort([6, 3, 4, 1]); // [1, 3, 4, 6]