Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
javascript-fundamentals
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Cottier
javascript-fundamentals
Commits
1503bcb8
Commit
1503bcb8
authored
Apr 09, 2021
by
ccottier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some real solid work
parent
da3a8548
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
myscript.js
myscript.js
+81
-0
No files found.
myscript.js
View file @
1503bcb8
...
@@ -44,6 +44,7 @@ document.addEventListener("DOMContentLoaded", ()=> {
...
@@ -44,6 +44,7 @@ document.addEventListener("DOMContentLoaded", ()=> {
const
returned
=
imGonnaReturnMyself
();
const
returned
=
imGonnaReturnMyself
();
const
counterFactory
=
()
=>
{
const
counterFactory
=
()
=>
{
//nifty closure here
let
count
=
0
;
let
count
=
0
;
return
(
return
(
()
=>
{
()
=>
{
...
@@ -81,6 +82,86 @@ document.addEventListener("DOMContentLoaded", ()=> {
...
@@ -81,6 +82,86 @@ document.addEventListener("DOMContentLoaded", ()=> {
console
.
log
(
"string>"
);
console
.
log
(
"string>"
);
break
;
break
;
}
}
//REVIEW TOPICS FROM PRADEEP
// Variables - Scopes
const
globalScopedVar
=
"worldwide"
;
function
funcScope
(){
var
funcScopedVar
;}
if
(
true
){
let
blockScopeVar
;
}
// Functions
function
regFunction
(
arg
){
console
.
log
(
arg
);
}
const
arrowFunc
=
()
=>
"look out I'm pointy"
;
(
function
(){
return
"I'm just an IIFE"
})();
class
ImAClass
{
static
method
=
()
=>
{
console
.
log
(
"I'm a method of "
+
this
.
toString
());
}
static
toString
(){
return
"ImAClass"
;
}
}
const
methodFunc
=
ImAClass
.
method
;
methodFunc
();
// Operators
const
add
=
2
+
2
;
const
sub
=
2
-
10000000
;
const
mult
=
4
*
4
;
const
division
=
5
/
5
/
5
;
const
mod
=
10
%
2
;
const
exp
=
3
**
3
;
// Conditional statements
if
(
true
)
{
const
iWill
=
"do this"
;
}
else
if
(
null
===
true
)
{
const
iWould
=
"do this instead"
;
}
else
{
console
.
log
(
"something bad has happened if you've gotten here"
);
}
//see my switch above
// Loops
for
(
let
i
=
9
;
i
<
100
;
i
+=
2
){
//something looping about 45 times
}
let
condition
=
true
;
while
(
condition
){
let
thoughtProcess
=
"better set this condition to false"
;
condition
=
false
;
}
function
something
(){
console
.
log
(
"ta da"
)
}
do
{
something
();
}
while
(
undefined
);
console
.
log
(
"we are at the conclusion, thanks for your time."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment