Skip to content
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

Docusaurus alpha 62 #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ssjs/ssjs-if-and-switch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ In the above example, we are doing multiple tests ordered from the easiest to th

### Pseudo-Ternary

Despite the JavaScript [ternary](/docs/js/js-if-and-switch.mdx#ternary) operator is not supported in SSJS, you can leverage shortcircuiting to get the same outcome. If a simple `if` statement has only two possible outcomes depending on a condition, ternary is more straightforward and readable alternative. Based on previous example, instead of:
Despite the JavaScript [ternary](#ternary) operator is not supported in SSJS, you can leverage shortcircuiting to get the same outcome. If a simple `if` statement has only two possible outcomes depending on a condition, ternary is more straightforward and readable alternative. Based on previous example, instead of:

```js {2-7} title="Dirty if statement using basic 'if'"
for (var customer in customers) {
Expand All @@ -179,7 +179,7 @@ Instead of 6 lines of code, we have 1. Awesome! But how does it work? The pseudo

:::note You Should Know

You can leverage similar logic to trigger functions or [debugging](/docs/ssjs/debugging-ssjs#debugging-variable):
You can leverage similar logic to trigger functions or [debugging](#debugging-variable):

```js title="If isLoggedIn is false, the redirectToLogInPage function will be executed"
!isLoggedIn && redirectToLogInPage();
Expand Down Expand Up @@ -232,4 +232,4 @@ switch (a, operation, b) {

- Use either `break` statement to end each case or use the `return` statement if in function. Otherwise, the switch will also execute all below cases until it encounters one of the above keywords (or hits the last scenario). Of course, there might be some edge scenarios where you want this exact behaviour to happen.
- Always use `default` statement, even if you believe it will never be triggered (not required, but best practice). Use it to handle the scenario you haven't considered.
- Cases in a `switch` are using strict comparison (`===`) for evaluation, so the provided value must match the case not only by value but also by type. A string value of `'0'` won't trigger an integer `0` case.
- Cases in a `switch` are using strict comparison (`===`) for evaluation, so the provided value must match the case not only by value but also by type. A string value of `'0'` won't trigger an integer `0` case.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.61",
"@docusaurus/preset-classic": "^2.0.0-alpha.61",
"@docusaurus/plugin-client-redirects": "^2.0.0-alpha.61",
"@docusaurus/core": "^2.0.0-alpha.62",
"@docusaurus/preset-classic": "^2.0.0-alpha.62",
"@docusaurus/plugin-client-redirects": "^2.0.0-alpha.62",
"classnames": "^2.2.6",
"prism-react-renderer": "^1.1.1",
"react": "^16.8.4",
Expand Down
1 change: 1 addition & 0 deletions sidebars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading