Skip to content

Instantly share code, notes, and snippets.

View haryantowang09's full-sized avatar

haryantowang09 haryantowang09

View GitHub Profile
@haryantowang09
haryantowang09 / TheHeader.vue
Last active August 17, 2023 18:06
What could happen Vue CSS Scope with @import
/**
* Asnwer:
* @import new-style.css wrapped inside <style scope> won't make the CSS code imported become scoped
**/
# Correct Scoped
<style scoped>
header {
width: 100%;
height: 5rem;
@haryantowang09
haryantowang09 / .optionalChain
Created June 15, 2023 09:02
Javascript with Optional chainging
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
const dogName = adventurer.dog?.name;
console.log(dogName);
// Expected output: undefined
@haryantowang09
haryantowang09 / logical.theory
Last active June 15, 2023 05:42
Javascript Logical
a || b
in short, this is democracy, if one of them is a Yes man, we all yes man.
Read more
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR
a || b || c
How does this work to?
Thanks ChatGPT-san,