var getInformation = (baseUrl) => (path) => (id) => {
console.log(baseUrl + path + '/' + id);
return baseUrl + path + '/' + id;
};
var imageUrl = 'http://image.com/';
var productUrl = 'http://product.com/';
//이미지 타입별 요청 함수 준비
var getImage = getInformation(imageUrl);
var getEmoticon = getImage('emoticon');
var getIcon = getImage('icon');
//제품 타입별 요청 함수 준비
var getProduct = getInformation(productUrl);
var getFruit = getProduct('fruit');
var getVegetable = getProduct('vegetable');
//실제 요청
var emoticon1 = getEmoticon(100);
var emoticon2 = getEmoticon(102);
var icon1 = getIcon(205);
var icon2 = getIcon(227);
var fruit1 = getFruit(300);
var fruit2 = getFruit(400);
var vegetable1 = getVegetable(901);
var vegetable1 = getVegetable(942);
출처 : 코어자바스크립트(정재남, 2020 개정판)