Skip to content

Instantly share code, notes, and snippets.

View n00nietzsche's full-sized avatar
🎯
Focusing

제이크 서 (Jake Seo) n00nietzsche

🎯
Focusing
View GitHub Profile
@n00nietzsche
n00nietzsche / .js
Created March 8, 2023 13:34
템플릿 태그 함수 예제
const insertHTML =
(selector, { position = "beforeend", prefix = "", suffix = "" }) =>
(strings, ...values) => {
const $selected = document.querySelector(selector);
if ($selected) {
const htmlString = strings.reduce((result, string, i) => {
result += string;
if (values[i]) {