let x; // Declare a block-scope variable
const y = 2; // Declare a block-scope, read-only constant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.stickyScroll.enabled": true, | |
"editor.scrollbar.horizontal": "hidden", | |
"editor.scrollbar.vertical": "hidden", | |
"security.workspace.trust.untrustedFiles": "open", | |
"workbench.settings.editor": "json", | |
// * Editor | |
"editor.cursorSmoothCaretAnimation": "on", | |
"editor.accessibilitySupport": "off", | |
"editor.renderWhitespace": "boundary", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount } from '@cypress/vue'; | |
import Toast from '@/components/toast'; | |
import '@/assets/css/style.css'; | |
const toastTemplate = { | |
template: ` | |
<div class="w-screen h-screen bg-grey-200"> | |
<div class="text-center pt-8"> | |
<button @click="$refs.toast.success({ title: 'New action, pushing the previous one', description: 'Description for the action, containing links' })">Success</button> | |
<button @click="$refs.toast.error({ title: 'Action failed', description: 'Sorry, your action didn’t come through' })">Error</button> |
- loading spinner: https://play.tailwindcss.com/u2QagzrBWk?layout=horizontal
Error message
TypeScript error in FormSignUp.tsx(43,19):
Argument of type '{ [x: string]: string; }' is not assignable to parameter of type 'MyState | ((prevState: Readonly<MyState>, props: Readonly<{}>) => MyState | Pick<MyState, keyof MyState> | null) | Pick<...> | null'.
Type '{ [x: string]: string; }' is missing the following properties from type 'Pick<MyState, keyof MyState>': name, email, confirm_email TS2345
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeInitial = (name) => { | |
const rgx = new RegExp(/(\p{L}{1})\p{L}+/, 'gu'); | |
let initials = [...name.matchAll(rgx)] || []; | |
return ( | |
(initials.shift()?.[1] || '') + (initials.pop()?.[1] || '') | |
).toUpperCase(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nestedLoop(obj) { | |
const res = {}; | |
function recurse(obj, current) { | |
for (const key in obj) { | |
let value = obj[key]; | |
if(value != undefined) { | |
if (value && typeof value === 'object') { | |
recurse(value, key); | |
} else { | |
// Do your stuff here to var value |
document.querySelector('img[srcset*="fbcdn"]')
.srcset.split(',').pop()
.match(/\bhttps?:\/\/\S+/gi)[0]
NewerOlder