응용 (1) 썸네일형 리스트형 [JS] 배열 합치기, join 응용 var buffer = { entries : [], add : function(s) { this.entries.push(s); }, concat : function() { return this.entries.join(""); } }; var source = ["867", "-", "5309"]; source.forEach(function(s) { buffer.add(s); }); buffer.entries.join(""); result : "867-5309" 이전 1 다음