-var tasks = [];
+var tasks: string[] = [];
+
+function createViewTask(task: string) {
+ const viewTask = document.createElement("div");
+ viewTask.appendChild(document.createTextNode(task));
+ return viewTask;
+}
+
+function updateView() {
+ tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t)));
+}
function addTask(task: string) {
tasks.push(task);
+ updateView();
}
function browserCreateTask(form: any) {