Skip to content

Commit

Permalink
refactor(levels): improve 21 and 22
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jun 2, 2024
1 parent 1e5817e commit fcb64a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
11 changes: 1 addition & 10 deletions src/levels/21.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ ${registerWinCondition(level)}
${registerPasswordCheck(password)}
${addText('Pass the Promise')}
window.isPromise = (value) => value instanceof Promise
`

export const script = `
Expand All @@ -40,13 +38,6 @@ export const script = `
const key = get('key')[0]
// example of successful Promise
const examplePromise = Promise.resolve('some value')
examplePromise.then((value) => {
// console.log(value)
key.password = value
})
// set \`key.password\` to the resolved value of \`key.promise\`
console.log('is promise?', isPromise(key.promise))
key.promise
`
9 changes: 1 addition & 8 deletions src/levels/22.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ export const script = `
const key = get('key')[0]
// example of failed Promise
const examplePromise = Promise.reject('some value')
examplePromise.catch((value) => {
// console.log(value)
key.password = value
})
// set \`key.password\` to the rejected value of \`key.promise\`
console.log('is promise?', isPromise(key.promise))
key.promise
`

0 comments on commit fcb64a1

Please sign in to comment.