function toast(msg, type = 'success') {
const el = $('')
.addClass(type)
.text(msg)
.appendTo('body')
.fadeIn(300);
setTimeout(() => el.fadeOut(300, () => el.remove()), 3000);
}
toast('Saved!');
toast('Error occurred', 'error');
Sign in to track your progress.