►
From YouTube: Functional Programming Day 1 - Ruddy Riba
Description
This talk will deep dive in some of the key concepts of Functional programming and how you can start using it in your javascript code today.
This talk was recorded at the Jozi.JS meetup group on 20 September 2018.
https://www.meetup.com/Jozi-JS/events/252700239/
Disclaimer: The opinions in this talk are those of the individual and do not necessarily represent those of this channel, the meetup group, or it’s sponsors.
A
I'm
so
hi
everybody
in
the
spirit
of
being
more
inclusive,
I'm,
going
to
ask
you
guys
a
couple
of
questions
and
obviously,
throughout
the
whole
process,
we're
just
going
to
talk
to
each
other
and
and
the
reason
why
I
make
this
very
explicit
is
that
if
anyone
wants
to
jump
in
and
explain,
certain
concepts
feel
free
to
do
that.
Okay,
so
who
of
you
in
this
crowd,
actually
has
developed
in
a
functional
programming
kind
of
style?
A
Awesome
alright,
and
of
you
guys
how
many
of
you
have
actually
heard
concept
like
lodash
ram
de
underscore
type
thing:
okay,
we're
not
gonna,
be
talking
about
any
of
those
libraries,
but
hey!
Alright.
As
you
can
see,
this
is
a
Deadpool
inspired
talk.
So
if
you
do
not
like
Deadpool,
this
is
going
to
be
an
extremely
terrible
presentation
for
you.
So,
like
you
simply
won't
get
the
jokes
and
that's
fine.
Also,
it's
not
a
train
smash
but
yeah
just
like
make
yourself
ready
for
that,
alright
cool.
A
So
in
the
spirit
of
being
more
Deadpool
ish
right.
Just
imagine
right
that
Celine
Dion
is
singing
in
the
background
as
I
introduce
myself
right,
Who
am
I,
my
name
is
Rudy
I
am
a
software
developer
I
touch
a
little
bit
of
back-end
code,
such
a
little
bit
of
front-end
code,
so
I'm,
just
very
handsy
and
I
like
touching
so
yeah.
That's
me
and
the
other
ones
are
just
for,
in
effect,
to
get
you
guys
laughing
alright.
A
A
Now
we
are
here
to
kind
of
have
a
high-level
view
of
what
functional
programming
is
in
my
life,
I
decided
that
maybe
it
will
be
really
a
good
thing
to
start
actually
understanding
the
code
I
produce
and
what
kind
of
effects
it
has
in
the
outside
environment.
Basically,
right
and
if
you
were
to
take
one
thing
out
of
this
talk,
is
basically
the
idea
that
you
can
start
implementing
or
start
programming
in
a
function
way
right
now
with
what
you
can
have
unlucky.
A
Out-Of-The-Box
from
JavaScript
and
I
will
tell
you
and
show
you
what
the
exceptions
are
where
you
start
using
like
libraries
and
all
of
those
things,
but
you
can
theoretically
just
do
and
create
your
code
in
the
functional
programming
way
now
wikipedia
tells
us
that
functional
programming
is
a
paradigm
and
what,
basically,
that
means,
is
it's
a
way
of
viewing
your
code
or
structuring
your
code.
It's
not
a
different
language
and
it
has
existed
for
the
longest
time.
A
So
it's
just
basically
how
you
reason
about
your
code
right
and
the
next
section
it
talks
about
that
it
it
treats
computation
as
an
evaluation
of
mathematical
function.
When
people
see
this
in
a
definition
of
functional
language,
they
really
really
think
that
it's
very
tied
up
to
how
mathematic
is
and
by
mathematics.
In
my
head,
I'm
thinking
calculus
and
though
the
the
principles
are
the
same
I'll
kind
of
explain
to
you
what
it
means
right
in
that
context,
and
the
last
part
is
that
it
tries
to
avoid
States
highlights
on
a
void
right.
A
It
means
that
we'll
get
into
it
as
well,
but
like
it,
tries
not
to
mutate
state
at
most
control
when
it
actually
does
that
right.
In
my
journey
of
figuring
out
and
trying
to
be
more
functional,
right,
I
went
and
I
looked
at
this
guy
called
Nathan
Nathan
Taylor.
So
he
has
a
plural
course
right
and
there
he
kind
of
says
something
that
is
very
powerful
and
that
resonates
with
quite
a
few
of
us
right.
A
Functional
programming
helps
you
to
reason
about
your
code
and
what,
basically,
that
means
is
that
I
understand
I,
have
a
full
concept
of
a
concept
of
what
this
function
is
basically
doing,
and
therefore,
if
someone
were
to
ask
me
exactly,
why
did
you
do
it
and
why
you
did
it
this
way?
I
can
tell
you
what's
actually
happening
because
it
makes
sense
to
me
it
has
its
own
state
like
the
way
it
handles
its
own
parameters.
The
way
what
I'm
getting
out
of
the
functions
is
kind
of
something
that
makes
sense.
A
So
the
first
part
of
the
definition
of
functional
programming
is
that
it's
a
paradigm
now
JavaScript
being
this
amazing
beast
right,
supports
cut
a
list
of
the
list
of
these
paradigms,
one
of
them
being
imperative
programming,
so
imperative
programming
is
very
pedantic
on
detail.
It
is
like
a
command
like
creation
of
your
code.
So
what
you
do
is
that
I
start
doing
this
and
then,
when
I'm
done
with
that,
I'm
gonna
do
this,
and
in
order
for
me
to
get
this
I
need
to
do
this.
A
So
it
is
the
how
as
to
how
your
code
is
actually
going
to
do
or
achieve
something
right.
So
that's
imperative
style
of
programming
and
the
problem
with
this
is
that
each
and
every
one
of
these,
this
that's
what
and
whatnot
maintain
their
own
state.
So
if
they
do
that,
that
means
that
if
ever
your
program
was
to
be
larger,
it'll
be
a
lot
harder
for
you
to
keep
managing
the
state.
So
to
answer
that
question,
we
then
create
object-oriented
programming.
All
right-
and
the
idea
of
this
is
that-
are
we
gonna?
A
That's
gonna
have
a
wall
effect
at
the
end,
so
in
case
you're
waiting
for
that
I'm.
Sorry,
there's
gonna
be
like
a
lip
cherish
kind
of
vibe,
so
I'm,
sorry
about
that
cool,
and
then
we
continue
metaprogramming
right
in
my
Chris
of
China's
figure
out
how
functional
programming
works
and
how
to
actually
start
using
it
right.
I
came
across
this
book
called
functional
JavaScript
by
Michael,
Fergus
I.
Think
now,
Michael
further
says
what
is
meta
programming
right
and
he
says,
programming
occurs
when
you
write
code.
A
That
does
something
metaprogramming
occurs
when
you
write
code
that
changes
how
something
is
interpreted
so
I'm
gonna
say
that
again,
programming
happens
when
you
create
code.
That
does
something,
but
metaprogramming
happens
when
you
create
code
that
changes.
How
something
is
interpreted.
I
have
few
examples
of
this
and
I'm
going
to
show
you
if
you
are
interested-
and
we
can
talk
about
it
later
on,
but
this
drives
us
to
the
next
amazing
thing,
which
is
declarative
programming
in
opposites
to
imperative
declarative
programming,
says
I,
don't
care
what
you
do
with
a
code.
A
I
just
want
you
to
do
something
for
me
and
give
it
back
to
me
all
right.
So
functional
programming
is
really
closely
into
what
declarative
programming
is
all
about,
and
the
reason
why
I
say
that
is
because
functional
programming
says
I
really
actually
don't
know
the
I,
don't
want
to
care
about
the
how
I
want
to
care
about
the
what
that
I'm
trying
to
get
out
of
the
of
the
program
or
whatever
I'm
coding,
right
and
yeah.
So,
let's
just
look
at
a
few
examples.
A
The
two
distinctive
paradigms
are
these
two
right,
so
imperative
is
the?
How,
if
you
looked
at
it's
a
normal
for
loop
right,
I've
got
I'm
gonna
declare
a
block
which
is
a
for
loop
in
it
I'm
going
to
declare
an
iterator
which
is
I
and
I'm
going
to
go
through
my
squad
right
and
which
is
an
array
and
loop
through
it
find
an
attribute,
call,
that's,
modify
and
assign
a
date
to
it.
A
All
right,
declarative
programming,
then
says
I,
really
don't
care
how
you
do
that
iterator
there's
my
array
go
to
something
in
this
case
map
which
is
going
to
go
and
iterate
for
you
through
your
array
and
then
go
and
find
an
attribute
called
last
modified
and
assign
something
to
it.
So
you
can
see
it's
still
in
JavaScript,
but
the
behavior.
The
way
you
thinking
of
recurred
is
a
little
bit
different.
A
Now.
The
another
part
of
this
definition
was
that
it
is
a
treat
computation
as
an
evaluation
of
functions
all
right
and
in
its
essence,
in
its
core.
What
it
says
that
every
time
I
call
a
function,
it
should
give
me
the
same
information
back
right
and
just
like
a
mathematical
function.
This
simple,
f
of
X
function
accepts
a
value
called
eggs.
A
Then
we'll
multiply
whatever
that
value
is
by
five
right
and
you're
going
to
pass.
This
parameter
to
the
function.
Parameters
are
being
excised,
so
I
am
going
to
give
you
X,
and
in
this
case
my
X
is
also
five
and
I
know
that
in
your
function,
you're
going
to
multiply
that
by
five
and
give
me
a
response.
This
is
very
linked
to
the
concept
of
pure
functions
within
job
within
a
functional
programming.
It
says
it
only
depends
on
its
parameters
and
give
me
those
parameters
to
work
with
right
and
I'll.
A
Give
you
a
returned
object
back
and
you
can
predict
what
is
going
to
happen
in
that
function
because
you're
looking
at
it,
and
it
makes
sense
to
you
so
I'm,
going
to
create
a
function
that
accepts
a
parameter
that
is
X
and
that
X
is
going
to
be
multiplied
by
five
and
it's
going
to
return
a
value
to
me
and
that's
what
it
means
by
his
country.
Teaching
computation
is
evaluation
of
meth
of
meth
cool
and
then
the
last
part
of
the
definition
is
mutable
data
right.
A
Right
is
the
fact
that
we
assume
that
calling
functions
like
sort
actually
don't
modify
the
initial
array
or
the
array
that
it's
working
on,
but
it
does
so
when
you
have
an
array,
in
this
case
key
and
you're,
trying
to
sort
it
from
in
from
1
to
8
or
whatever
right,
when
you
run
that
code
on
sort,
what
is
actually
going
to
modify
key
all
right
and
when
you
return
this,
you
want
us.
Okay,
I've
got
this
new
array,
but
actually
you
modified
the
previous
or
the
the
area
that
you
are
working
on
right.
A
There
are
very
few
attributes
in
JavaScript
that
I
immutable
in
string
being
one
of
them,
but
arrays
are
not
all
right
cool
now,
let
all
of
that
definition
sink
in,
and
everybody
understands
what
I'm
talking
about
and
I'm,
not
talking
too
fast.
Why
do
we
want
to
do
this,
and
two
people
actually
use
functional
programming?
Why
do
we
want
to
do
it?
Why
why
do
you
choose
using
functional
programming
as
your
style
of
code.
A
A
Exactly
awesome,
yeah
cool
everything
that
the
guys
just
said
right
and
the
fact
that
first
functional
program
is
not
new.
There
is
support
these
resources
around
and
you
can
start
just
using
it
right
and
people
and
their
resources
easier
to
for
you
them
to
explain
certain
things
it
has
just
existed.
So
it's
not
something
that
needs
to
be
like
this
I,
don't
know
something
you
go
for
a
retreat
for
and
why
not?
A
A
I
already
mentioned
this,
but
something
that
you
mentioned
right
simplifies
complex,
touch
points
when
you
I,
don't
know,
if
guys
have
had
its
experience
when
you
go
to
some
project
and
they've
got
this
code,
that
lilyc
is
doing
too
much
the
functions
along
and
every
time
you're
trying
to
debug
something
it
just
takes
the
whole
day
type
of
situation.
So
because
you
can
break
apart
functions,
you
can
actually
like
be
in
control
of
what
that
function.
A
Does
because
you
actually
are
giving
the
parameters
that
it
needs
and
it
will
always
respond
to
you
with
an
array.
You
kind
of
know
that
okay
I've
got
the
function
that
does
this
I've
got
this
function,
that
does
this
I
can
put
those
things
and
type
them
together
and
change
them
together,
but
they
all
form
these
individual
parts
where
it's
easier
than
to
follow
how
the
code
is
going,
because
sometimes
you
really
read
code.
That
is
really
really
really
bad,
and
it
takes
me
way
too
long
for
you
to
get
your
job
done.
A
So
if
ever
we
kind
of
implemented
this
room,
make
our
lives
easier,
cool,
another
thing
reusability.
So,
in
reference
to
the
previous
example
that
we
had
with
declarative
and
imperative
right,
the
first
one
explicitly
took
a
value
of
10
that
it
iterated
through
right.
So
that
means
that,
if
ever
to
put
that
in
the
function,
I
can
only
iterate
10
items
but
with
the
wave
function
of
programming
and
the
way
you
think
about
your
code.
A
It
allows
you
to
create
a
function
set
that
if
you
don't
want
to
pass
10
today,
you
can
pass
100
tomorrow.
You
can
do
this
because
it
can
handle
all
those
things
so
because
you're
not
worried
about
the
how
you
just
have
a
fun
thing
that
you
want
to
achieve,
and
you
are
kind
of
you
know
being
explicit
about
it
right
and
then
testing
I
am
going
to
take
some
time
in
actually
talking
about
this.
Well,
not
a
lot
of
time,
but
based
on
how
pure
functions
are
right.
A
When
you
test
code,
it's
gonna
be
a
lot
easier
because
you
don't
have
to
start
marking
information
or
marking
these
dependencies
or
data
calls
and
whatnot.
You
give
the
function,
what
it
needs
and
then
it
computes
something
and
you
check
if
ever
the
response
is
what
you
expect
last
thing:
it's
technically
not
faster.
A
So
the
reason
why
I
say
this
is,
and
everybody
can
like
obviously
jump
in
right
when
you
see
a
for
loop
anyway,
in
your
code,
you
have
an
opportunity
to
be
recursive
and
recursive
means
calling
a
function
over
and
over
again.
That
really
really
really
plays
on
your
performance,
all
right.
Another
thing:
for
the
sake
of
not
being
or
trying
to
be
more
immutable
right,
you
will
be
creating
these
objects
and
creating
a
copy
of
something
at
some
point,
and
that
really
works
your
garbage
collector.
A
A
It
creates
because
your
mental
map
and
how
you
put
things
together,
kind
of
make
some
logical
sense,
it's
easier
for
you
to
start
creating
code
and
code
that
you
fully
understand,
because
you
kind
of
have
abreast
of
the
simplicity
of
how
functional
programming
is
cool
now
with
holiness
seed.
Just
let
it
sink
in
also
because
there's
levels
of
how
deep
you
going
to
get
with
this,
so
I
needed
to
like
yeah
get
in
there,
alright,
alright!
So
let's
talk
about
fewer
functions.
What
are
pure
functions.
A
Okay,
pure
functions
first
depend
on
their
parameters
or
why
or
what
or
what
you
pass
it?
They
always
give
you
a
return
value,
so
void
is
technically
not
a
function.
A
pure
function
does
not
use
global
variables
because
it
really
tries
to
avoid
mutating
the
states
around
it
so
having
a
function
that
does
a
console.log,
for
example,
it's
kind
of
not
a
pure
function,
because
that
thing
is
influencing
a
state
outside
of
that
functions.
Environments,
and
that
is
not
what
we're
trying
to
do.
We're
trying
to
avoid
that
as
much
as
we
possibly
can.
A
Okay,
examples
of
a
bad
function.
Now,
what
you
see
here
is
they
pool
squad?
It's
an
array
of
objects
that
takes
in
lucky
Peter
and
Deadpool
in
there
they've
got
super
powers
and
we've
got
this
function.
Call
let's
fly
anyone
who
watched
it.
Fool
really
should
get
this,
but
anyway,
so
we've
got
an
access
to
this
of.
Can
you
see
Microsoft
awesome,
okay,
this
array
here,
which
is
actually
a
global
variable.
We
are
going
into
it
and
then
going
and
finding
super
power
and
adding
1
to
it.
A
This
is
a
horrible
code,
guys
and
I'm
just
driving
a
point
so
bear
with
me
all
right
and
then,
after
that
it
does
this
console.log
out
after
the
definition
of
what
a
pure
function
is
we
already
see
well
how
many
things
this
function
is
violating
first
going
in
using
a
global
variable.
Secondly,
does
not
return
anything.
Thirdly,
changes
of
the
environment
around
it.
So
that's
not
a
really
really
good
example.
A
Then
we
come
to
the
awesome
highs
again.
We've
got
the
object
we
passing
date,
for
you,
don't
necessarily
need
to
create
the
copy.
Obviously,
because
you've
got
the
variable
here
and
it's
individual
from
the
global
one.
But
I
did
it
anyway,
all
right
and
then
you
use
that
go
and
get
power
and
set
one
to
it
still
do
the
shift.
A
A
That
is
like
all
like
the
two
major
thing
about
functional
JavaScript
right,
which
is
like
the
pure
functions
and
how
not
to
mutate
state
and
that's
just
like
a
good
basis
and
before
we
get
into
how
we
can
make
our
functions
less
complex
and
breaking
them
apart
and
doing
really
really
cool
things
about
it.
That's
like
the
basic
cry.
If
you
want
you
to
know
what
it
is,
they
got
it
and
you
can
start
doing
this
in
your
code
right
now.
You
can
start
controlling
how
your
your
your
functions
are:
mutating
States.
A
You
can
start
controlling
what
you
pass
in
to
your
function
and
what
you
get
out
of
it,
something
that
you
can
do
today
in
a
spirit
of
being
inclusive.
If
you
look
at
this
code,
all
right,
we've
got
var
birth
that
has
five
to
it,
and
then
we
go
and
create
a
function
called
add
power
and
add
power
takes
in
a
variable
called
called
by
birth,
and
then
inside
of
it
has
an
inner
function
that
takes
by
mutation
and
then,
as
by
mutation
with
birth.
A
After
that,
we
interact
with
our
function,
add
power
we
passed
a
into
it
and
then
this
will
return
the
function
and
we
passed
20
to
it.
So
my
question
to
you
guys
is
what
would
be
the
output
of
increased
power
or
after
we
run
increase
power.
Everybody
else
who
knows
what
this
concept
is:
keep
Wyatt
so
just
kiss.
A
A
Okay,
cool.
That
is
a
correct
answer
by
the
way.
No,
that
is
actually
a
good
answer.
So
I'm
gonna
explain
the
concept
of
what's
happening
here,
but
before
I
do
that
I'm
gonna.
Take
you
guys
on
to
your
journey,
so
please
held
onto
your
hats,
because
I'm
going
to
go
places
all
right
and
hopefully
I
land
in
the
right
place.
Okay,
cool
now.
A
Javascript
is
actually
compiled
all
right.
It
has
this
thing
called
just-in-time
compilation.
We
all
believe
that
it's
transpired
in
yes,
there's
some
truth
to
that,
but
there's
a
certain
part
of
it
that
is
actually
compiled
and
that
the
process
where
that
happens
just
before
your
application
executes
what
your
engine
does,
is
that
I'm
gonna
have
all
this
source
code
and
we'll
take
our
pipers
that
assigns
fast
as
an
example
right.
It
will
take
all
your
source
code
and
since
to
the
compiler,
a
compiler.
A
There's
your
source
code
compiled
and
goes
and
says:
hey
I've
got
a
variable
caused
by
birth
right
scope.
Do
you
have
by
birth
and
scope?
Is
that
no
I
don't
and
in
comparison,
okay,
cool
create
by
birth?
Now,
in
our
scope,
we've
got
by
birth
right.
The
engine
comes
back
and
says:
I've
got
this
inter
variable
value,
5
and
I
need
to
assign
it
to
something
called
by
birth
scope.
Do
you
have
by
birth
and
scope?
A
It
yeah
compiler
told
me
to
create
that
later
I,
like
a
little
bit
earlier,
so
I've
got
by
birth
and
engines.
Ok,
cool
I'll
assign
5.
If
your
engine
did
not
find
by
birth
at
the
innermost
cope,
what
it
will
do
is
go
back
to
the
artemis
cope
and
ask
out
of
scope.
Do
you
have
by
birth
and
other
scribbler?
A
A
Don't
if
your
code
is
not
on
strict
mode,
your
global
scope
will
say,
but
I
can
create
it
for
you,
because
this
is
what
I
do
right
and
it
should,
if
it
does,
that
now,
you've
got
by
birth
that
exists
somewhere
in
a
global
scope.
Who
you
don't
know
also
has
access
to
it,
and
if
a
change
could
really
affect
your
code,
alright,
but
in
other
your
code
is
in
strict
mode,
global
scope,
who's
gonna
be
like
no
I,
don't
have
it
enters
an
era
alright,
so
no
one
has
backwards.
A
Javascript
in
its
essence,
has
something
called
lexical
scope
and
our
lexical
scope
is
an
opposite
of
dynamic
scope
and
what
that
means
is
oh,
what
dynamic
scope
is
I
will
figure
out
the
scope
of
an
object
during
runtime,
lexical
scope
said:
I
will
define
a
variable.
Weight
is
being
authored
all
right,
so
when
it's
created
or
way,
I
see
it
in
source
code
is
where
I'm
going
to
create
it.
Now
we
come
back
to
this
function
that
you
see
over
here
right
in
a
scope.
A
This
guy
over
here
right
when
it's
created,
has
scope
right
because
it's
awesome
right,
hair
scope.
But
what
you
don't
know
is
that
it's
enclosed
in
these
two
brackets,
which
is
add
power
at
power,
has
its
own
scope.
But
add
power
is
not
only
in
its
own
scope,
but
it
is
the
inner
functions,
lexical
scope
and
this
function
works
and
is
30
because
of
a
concept
called
closure.
Closure
says
when
you
are
created,
like
you
have
access
to
your
surrounding
scope.
A
You
have
access
to
get
control
of
the
things
that
are
the
closest
scope
around
you
right.
So
when
increase
power
runs,
it
says:
hey
I
actually
saw
this
in
a
function
right
being
declared
within
add
power
right
and
in
the
inner
function
or
in
this
inner
function.
I've
got
something
called
by
birth,
but
I
don't
know
where
by
birth
comes
from.
A
The
next
part
is
currying,
which
speaks
very
closer
to
what
you
are
talking
about
and
having
to
really
like,
create
functions
and
like
in
their
own
different
state
and
putting
them
together,
tearing
them
apart
kind
of
situation
and
kind
of
decoupling.
How
like
difficult
your
touch.
Points
in
like
large
function
looks
like
so
currying
is
the
act
of
converting
a
function
that
takes
multiple
parameters
into
a
series
of
functions
that
only
take
one
parameter.
A
I'm
gonna
say
that
again,
currying
right
is
the
act
of
converting
a
function
that
takes
a
lot
of
parameters
and
creating
a
series
of
functions
that
only
take
one
parameter.
Example:
the
total
force
exports
total
strength.
We
have
a
function
there
that
takes
a
B
and
C.
Now,
when
I
said,
I'm,
not
gonna
talk
about
the
libraries
like
no
and
Ram
died,
and
all
of
that
here
they
become
an
exception,
because
JavaScript
doesn't
have
currying
inherently
right.
A
So
in
the
act
of
this
talk
being
functional
programming
that
you
can
start
using
now
without
adding
anything,
this
kind
of
fails,
because,
in
order
for
you
to
carry
a
function,
you'll
need
help
from
any
of
the
utility
libraries
that
are
available
being
rammed
ax
being
load
or
underscore
right.
In
this
case,
we
call
on
lo
right:
I
have
a
function
or
it
hello
has
a
helper
utility
function
curried.
A
So
after
I've
created
this
nice
function
of
mine,
I
carry
it
and
for
by
just
doing
that,
and
now
I'm
now
able
to
supply
in
that
function.
That
originally
took
three
parameter.
Only
one
right
and
then
do
that
again
and
do
that
again
and
do
it
again
pass
pass
three,
and
all
of
that
now
who
cares?
Why
would
I
want
to
do
this
because
it
feels
like
it's
too
complex
for
me
to
start
doing
or
using
it
now.
A
The
reason
why
you
want
to
do
currying
is
that
when
you
really
have
a
function,
that's
doing
way
too
much
for
its
own
good.
It
really
does
help
to
actually
break
that
function
apart
right
and
tying
it
and
putting
it
together
bit
by
bit
in
such
a
way
that
it
can't
it
kind
of
contextually
makes
sense
to
you.
So
when
I
look
at
this
code
right,
it
makes
sense
as
to
what
it's
doing,
because
it's
it's
visible.
It's
right
there.
All
right
and
I
can
put
these
things
bit
by
bit.
A
A
It
also
helps
with
testing
your
functions.
So
if
you
don't
have
something
that
has
been
marked
somewhere
that
you
need
for
this
function,
you
can
pass
one
of
the
function
that
it
needs
and
see
whether
or
not
it
does
what
you
want
it
to
do,
and
you
continue
and
you
continue,
and
you
continue
yeah
and
to
the
last
or
the
end.
Part
of
this
is
how
it's
easy
to
test
now.
A
I,
don't
know
you
if
you
guys
have
had
the
experience
of
having
to
mark
something
to
death
because
it
is
calling
a
database
and
it's
going
and
calling
some
service
before
I
actually
write.
What
I'm
trying
to
test
in
that
function?
I
am
busy
just
creating
objects
that
are
going
to
be
called
in
the
function,
and
all
of
that
so
in
here,
instead
of
trying
to
iterate
right
your
user
inside
this
function,
I
can
actually
create
another
function,
called
user
search
that
goes
in
there
and
finds
the
ID
that
I'm
looking
for
right
and
pass.
A
The
output
of
that
function
into
user
and
all
I
need
to
do
is
just
add
a
superhero
into
this
array
that
I
just
iterated
through.
So
if
I
were
to
or
want
to
test,
add
squad
member
all
right,
I
can
only
if
I
can
just
pass
in
an
array
that
has
the
object
that
I'm
looking
for
and
pass
in
what
I
want
to
push
to
the
array,
and
it
will
return
a
function
to
me,
easy
that
we
can
move
on,
and
that's
why
this
is
so
cool.
A
So,
thank
you
very
much
for
listening
to
me.
This
is
the
end
of
my
talk
and
hopefully
you
guys
can
see
how
you
can
start
using
functional
programming
or
at
least
entertain
the
idea
of
how
all
of
the
possibilities
of
using
functional
style
of
coding
into
your
everyday
JavaScript
creation,
awesome,
and
the
last
thing
I
wanna
say,
is
check
out
these
sources.
The
book
that
I
was
telling
you
guys
about
so
like
disclaimer
on
that
functional
JavaScript.
A
It's
English
is
very
strong,
so
sometimes
when
you
like
reading
it's
just
like
you
just
need
to
have
like
some
dictionary
situation
going
on,
because
I
feel
like
he's
three
intense,
so
I
created
this
in
this
particular
order
because,
like
that
is
a
lightweight
like
the
nascent.
A
lot
is
like
high-level,
get
the
concept
done
right
and
angina,
like
also
does
the
same
thing:
she's
like
a
YouTube
video
type
situation
and
once
you've
got
those
concepts
and
kind
of
had
like
a
high
level
view
of
what
they
are.