Skip to content

Commit

Permalink
Merge pull request #82 from Birkbeck2/loops-objects-files
Browse files Browse the repository at this point in the history
Add package.json file in starter files for objects
  • Loading branch information
joemull committed Jan 29, 2024
2 parents e7674ea + 6f08e5c commit 5fdbb9a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
Empty file removed workshops/objects/index-easier.md
Empty file.
15 changes: 11 additions & 4 deletions workshops/objects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## Part 1: Practical

The practical part of today’s workshop is contained in two files,
“shapes.js” and “extraColors.js”. Download both files or copy-paste into
your own versions to get started. Then follow the instructions in
“shapes.js”.
The practical part of today’s workshop is mostly in one file, “shapes.js”.
Download it to get started.

There are some optional steps at the end that also require two other files:
“extraColors.js” and “package.json”. Download both files or
copy-paste into your own versions to get started. Then follow the
instructions in “shapes.js”.

[Download shapes.js](https://github.com/Birkbeck2/web-development/blob/main/workshops/objects/starter-files/shapes.js)

Expand All @@ -15,6 +18,10 @@ your own versions to get started. Then follow the instructions in

<<< @/workshops/objects/starter-files/extraColors.js{js}

[Download package.json](https://github.com/Birkbeck2/web-development/blob/main/workshops/objects/starter-files/package.json)

<<< @/workshops/objects/starter-files/package.json{json}

## Part 2: Creative

Choose one of the three options below.
Expand Down
3 changes: 3 additions & 0 deletions workshops/objects/starter-files/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
19 changes: 7 additions & 12 deletions workshops/objects/starter-files/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,16 @@
// 11b. OPTIONAL
// The next two steps involve exporting and importing with a pattern from ES
// modules. We did not cover all the steps in class, so they are optional.
// Create a file called 'package.json' and paste in this code (without the
// forward slashes.)
//
// {
// "type": "module"
// }
//
// Here is a one minute video explanation:
// Make sure you've downloaded the file package.json and saved it in the same
// folder as this one.
// Here is a one minute video demo of "type":"module" in package.json:
// https://www.youtube.com/watch?v=I4gR-1qMjk0

// 12. OPTIONAL
// Make sure you've downloaded the file extraColors.js and saved it in the same
// folder as this one. Modify the line where the pinkAndYellow object is
// defined, so that it is exported. Then import it below, in this file, and log
// it to the console.
// Make sure you've downloaded the file extraColors.js and saved
// it in the same folder as this one. Modify the line where the pinkAndYellow
// object is defined, so that it is exported. Then import it below, in this
// file, and log it to the console.


// 13. OPTIONAL
Expand Down

0 comments on commit 5fdbb9a

Please sign in to comment.