자바스크립트 최소화

불필요한 코드 서식을 제거하며 결과는 압축 파일이 아닌 텍스트입니다.

입력: 텍스트결과: 텍스트

텍스트 입력

예제

Remove an unreachable branch from a feature check

입력

function enabled() { if (false) { return "debug"; } return "ready"; }

Expected answer

function enabled(){return"ready"}
Fold a byte-count constant without changing its value

입력

const kibibytes = 1024 * 1024; function bytes() { return kibibytes; }

Expected answer

const kibibytes=1048576;function bytes(){return 1048576}
Shorten local names in a rectangle-area helper

입력

function area(width, height) { const result = width * height; return result; }

Expected answer

function area(n,r){return n*r}
Keep UTF-8 text intact while dropping whitespace

입력

function greeting() { return "Bonjour, café ☕"; }

Expected answer

function greeting(){return"Bonjour, café ☕"}
Preserve the order of state changes in a counter

입력

function count() { let n = 0; for (let i = 0; i < 4; i++) { n += i; } return n; }

Expected answer

function count(){let t=0;for(let n=0;n<4;n++)t+=n;return t}

관련 도구

코드 정리

작업 참고 자료

원본 기술 문서 보기 (English)