From 2c03c54258837ce0979a60ce9740fcdf5b2777f4 Mon Sep 17 00:00:00 2001 From: azizck Date: Tue, 1 Oct 2019 16:31:30 -0400 Subject: [PATCH 1/2] done --- js/main.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 js/main.js diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..7054b7a --- /dev/null +++ b/js/main.js @@ -0,0 +1,64 @@ + +/* +Aziz Omar +Practice week 10 +*/ + +//1 +// global variable, outmost scope + let queen = " I am global "; + + function scopeDemo(){ + // local variable + let pm = "I am local "; + } + + //console.log(pm) + // it throws an error because pm is only accessiable within the function + + +//2 + +// create a counter that increment by clicking the button + let counter = function(){ + // hold counter value + let i = 0; + // return function that adds one to the initial value + return function add(){ + i++; + return i; + }; + + // invoke outer function + }(); + + //add event listener to the button + document.getElementById("counter").addEventListener('click',function(event){ + // assign value of increment to dom + document.getElementById("output").innerHTML = counter(); + + }); + +//3 + document.getElementById("notify").addEventListener('click',function(event){ + // assign value of increment to dom + alert("you click a button "); + + }); + +//4 + + document.getElementById("resetBtn").addEventListener('click',function(e){ + e.preventDefault(); + document.forms[0].reset(); + + }); + +//5 +//line 8 with error: + // addalert("Welcome guest!"); + // some random characters are added to the object alert + +//line 8 after: + // alert("Welcome guest!"); + From 55b7d18004741414b136de7101b4a3092452df73 Mon Sep 17 00:00:00 2001 From: azizck Date: Tue, 1 Oct 2019 16:33:08 -0400 Subject: [PATCH 2/2] done --- debug.log | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 27 ++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 debug.log create mode 100644 index.html diff --git a/debug.log b/debug.log new file mode 100644 index 0000000..d8da473 --- /dev/null +++ b/debug.log @@ -0,0 +1,122 @@ +[1001/162054.715:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.716:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.716:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.717:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.718:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162054.719:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.086:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.087:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report +[1001/162445.088:ERROR:crash_report_database_win.cc(469)] failed to stat report diff --git a/index.html b/index.html new file mode 100644 index 0000000..67f6b24 --- /dev/null +++ b/index.html @@ -0,0 +1,27 @@ + + + + PRACTICE 10 + + + +
+ + +
+

+ output +

+
+ +
+ + + +
+ +
+ + + + \ No newline at end of file