Skip to content

Commit 4d6b95e

Browse files
authored
Create fp9.js
1 parent 7c630cf commit 4d6b95e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

fp9.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// 1. using destructuring, create a constant named
2+
// p, which is a function that will create paragraph tags
3+
// Remember, you'll need to use the "tags" namespace
4+
// to destructure from
5+
6+
const { p } = tags
7+
8+
// 2. create a constant named myParagraph by using the
9+
// p function you coded in step 1. The paragraph should
10+
// contain a sentence of your choosing.
11+
12+
const myParagraph = p('Lorem ipsum.')
13+
14+
// 3. create a constant named node, that references
15+
// the dom node where the id is 'app'.
16+
17+
const node = document.getElementById('app')
18+
19+
// 4. add your 'myParagraph' to the dom node you
20+
// coded in step 3
21+
22+
node.appendChild(myParagraph)
23+
24+
25+
// HINTS / HELP
26+
// If you need help, you can read the following docs:
27+
// hyperscript-helpers: https://github.com/ohanhi/hyperscript-helpers
28+
// destructuring: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring
29+
// reference dom node: https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById
30+
// adding html in code: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild
31+
// you can find my solution at: https://jsbin.com/najisaw/1/edit?js,output

0 commit comments

Comments
 (0)