-
Notifications
You must be signed in to change notification settings - Fork 286
Executable coding blocks production-readiness - PR 2 #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…or-undeclared-how-would-you-go-about-checking-for-any-of-these-states
…roperties-and-array-items
…erent-from-rest-syntax
…o-and-var-foo-function
…ax-how-does-this-new-syntax-differ-from-other-functions
…n-for-accessing-object-properties
…-method-in-a-constructor
@@ -86,7 +88,7 @@ const sayHello = () => 'Hello, World!'; | |||
|
|||
Arrow functions cannot be used as constructors and will throw an error when used with the `new` keyword. | |||
|
|||
```js | |||
```js live | |||
const Foo = () => {}; | |||
const foo = new Foo(); // TypeError: Foo is not a constructor | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for console.log(arguments)
, the lexical scope of our runCode
functions is being inherited, and thus the TypeError is not being thrown. Rather, we just get an empty object {}
which are the empty arguments of our runCode
function simply. Therefore, have left this codeblock unexecutable. Any ideas? I tried using globalThis but that would mess with other examples then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave it
Note: This is a stacked PR based off the earlier Executable coding blocks production-readiness - PR 1.
Adjusted code blocks for a further 34 questions to allow live execution.
console.log
statements to allow learners to correlate the code outcomes by running the cellsetTimeout()
and promises have been left non-executableMajor issues encountered:
lodash
and module import examples left non-executable