Notebooks 2.0 is here.
Read the preview announcement
Platform
Resources
Pricing
Sign in
Get started
samchencode
Workspace
Fork
Published
Fall 2018 App Club Lessons
By
samchencode
Edited
Sep 14, 2018
Fall 2018 App Club Lessons
To write an algorithm for a complicated problem
2018 JS Lesson 1: The basics
JS Lesson 2
Lesson 5: Classes and Prototypes
Lesson 8: \`new\`, \`__proto__\`, and \`prototype\`
Lesson 9: Filter, Map, & Reduce
Lesson 10: Finally Starting React
Insert cell
Insert cell
sumFunction
=
function
(
parameter1
,
parameter2
,
parameter3
)
{
// do some logic here
return
parameter1
+
parameter2
+
parameter3
;
}
Insert cell
Insert cell
// like so
result
=
sumFunction
(
1
,
2
,
3
)
// outputs 6
// we can set the result of the function to a variable so we can use it later
Insert cell
result
Insert cell
Insert cell
{
// save a function into a variable
const
addOne
=
function
(
someNumber
)
{
return
someNumber
+
1
}
const
multiplyByTwo
=
function
(
someNumber
)
{
return
someNumber
*
2
}
// we can copy a function into another variable
const
copyOfAddOne
=
addOne
const
doTwoThings
=
function
(
number
,
process1
,
process2
)
{
const
result1
=
process1
(
number
)
const
result2
=
process2
(
result1
)
return
result2
;
}
// whats the difference between the values
const
value1
=
doTwoThings
(
5
,
addOne
,
multiplyByTwo
)
const
value2
=
doTwoThings
(
5
,
multiplyByTwo
,
addOne
)
const
value3
=
doTwoThings
(
5
,
copyOfAddOne
,
multiplyByTwo
)
return
[
value1
,
value2
,
value3
]
}
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sumFunction
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
result
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML