함수형 프로그래밍과 JavaScript ES6+ 강의를 수강하며 정리한 내용입니다.
const a = 10; // 변수에 담을 수 있다.
const add10 = a => a + 10; // a + 10 : 함수의 결과로 사용될 수 있다.
const r = add10(a); // add10(a)의 a : 함수의 인자로 사용될 수 있다.
log(r);
const add5 = a => a + 5; // 함수를 값으로 다루어 add5에 넣을 수 있다.
log(add5); // 함수의 인자로 함수가 사용될 수 있다.
log(add5(5)); // 함수를 평가해 결과로 만들어 값을 다른 함수에게 전달할 수 있다.
const f1 = () => () => 1; // 함수의 결과값으로 함수가 사용될 수 있다.
log(f1()); // () => 1
const f2 = f1();
log(f2); // () => 1
log(f2()); // 출력:1, 원하는 시점에 평가 가능
const apply1 = f => f(1); // 함수가 함수를 받아 안에서 실행
const add2 = a => a + 2;
log(apply1(add2)); // const apply1 = f => (a => a + 2)(1)
log(apply1(a => a - 1));
// 숫자(n)만큼 함수(f)를 실행하는 함수(times)
const times = (f, n) => {
let i = -1;
while (++i < n) f(i);
};
times(log, 3);
times(a => log(a + 10), 3);
const addMaker = a => b => a + b; // b => a + b 함수를 리턴
// 클로저 : b => a + b 함수는 파라미터 a를 계속 기억
const add10 = addMaker(10);
log(add10(5));
log(add10(10));
Transform your photos into beautiful Studio Ghibli-style artwork with our AI-powered platform. Experience the magic of a Ghibli AI generator for fast, easy, and stunning results in the iconic studio ghibli style. https://ghiblistyleai.org
https://detectorfaceshape.com Get personalized style advice and discover what is my face shape with our advanced AI face shape detector and analyzer. Experience the most accurate face shape detection online.
Obby is a free online game with 35 unique Obby levels. No download required, play on any device with a web browser! https://obby.online
https://kourio.online Kour.io is a fast-paced online multiplayer FPS developed by LEGiON Platforms, blending retro pixel-art aesthetics with modern tactical gameplay. Updated in November 2024, it features 5 dynamic maps, 7 unique character classes, and a weapon progression system that evolves from pistols to rocket launchers. Players engage in cross-platform battles (PC/mobile/browser) across three core modes: Team Deathmatch, Gun Game, and Free-for-All. With over 1.8 million players globally, it supports 60FPS gameplay and community-driven content via a built-in map editor.
https://squaredle.online squaredle is a highly captivating and completely free daily word puzzle game, ingeniously developed by the team at Fubar Games. Offering a significant and refreshing twist on the popular daily word game format popularized by Wordle, squaredle presents a unique challenge that has quickly garnered a dedicated following. Originally launched in 2022 and consistently updated (latest noted update March 2025), this engaging game tasks players with solving six distinct five-letter words that interlock cleverly on a standard 5x5 grid. Success in squaredle relies on logical deduction, a good vocabulary, and strategic use of its intuitive color-coded hint system.
https://flipbottle.org Welcome to bottle flip, the most advanced online bottle flipping game! Challenge yourself with realistic physics, compete globally, and experience the thrill of landing the perfect flip.
Whether you're a casual player or aiming for the leaderboards, our physics-based gameplay provides endless entertainment and challenge. Start flipping now and join millions of players worldwide!
https://bouncy-balls.org The classroom noise management tool designed for teachers supports multiple display modes to make classroom management more intuitive, fun and efficient.
Experience Apple Worm, a modern take on the classic snake game featuring 50+ challenging levels, stunning apple-themed graphics, and real-time global rankings. Perfect for casual gamers seeking nostalgic yet innovative gameplay. https://appleworm.org/
Experience Apple Worm, a modern take on the classic snake game featuring 50+ challenging levels, stunning apple-themed graphics, and real-time global rankings. Perfect for casual gamers seeking nostalgic yet innovative gameplay. https://appleworm.org/