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
let person = { | |
firstName: 'John', | |
lastName: 'Doe', | |
age: 25, | |
ssn: '123-456-2356' | |
}; | |
Object.keys(person).forEach(key => { | |
console.log(`${key}: ${person[key]}`); | |
}); |
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
<template> | |
<div id="app"> | |
<child-component ref="childComponent"></child-component> | |
<button @click="someParentAction">Click</button> | |
</div> | |
</template> | |
<script> | |
/* --Child Component*/ | |
let ChildComponent = { |
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 trueCondition = true; | |
const someObj = { | |
...trueCondition && { birds: "tweet" }, | |
...(trueCondition && { dogs: "woof" }), | |
}; | |
// someObj === { birds: 'tweet', dogs: "woof" } |
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
<section class="section"> | |
<div class="container"> | |
<div class="section__item item"> | |
<div class="item__button">Click btn</div> | |
<div class="item__content"> | |
<div class="item__body">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus voluptatum minus ipsum quas, eum ad inventore perferendis maiores distinctio nisi maxime sunt numquam veniam, tempore. Id error deleniti, odio atque.</div> | |
</div> | |
</div> | |
<div class="section__item item"> | |
<div class="item__button">Click btn</div> |
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
<section> | |
<div class="container"> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
</div> |
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
.someElem { | |
-ms-overflow-style: none; /* for Internet Explorer, Edge */ | |
scrollbar-width: none; /* for Firefox */ | |
overflow-y: scroll; | |
} | |
.someElem::-webkit-scrollbar { | |
display: none; /* for Chrome, Safari, and Opera */ | |
} |
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
<section> | |
<div class="translate-x-elem"></div> | |
</section> | |
<style> | |
section { | |
width: 800px; | |
min-height: 100px; | |
background: orange; | |
margin: 100px auto 100px auto; |
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
<div class="parent"> | |
<div class="child">111</div> | |
<div class="child">222</div> | |
<div class="child">333</div> | |
<div class="child">444</div> | |
<div class="child">555</div> | |
<div class="child">666</div> | |
</div> | |
<style> |
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
.someElem { | |
animation-name: rotation; | |
animation-duration: 1s; | |
animation-iteration-count: infinite; | |
animation-timing-function: linear; | |
} | |
@keyframes rotation { | |
0% { | |
transform:rotate(0deg); |
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
Number.prototype.customNumberFix = function(fractionalPart) { | |
let split = String(this).split('.'); | |
if (split.length > 1) { | |
let left = split[0]; | |
let right = split[1].substr(0, (!fractionalPart ? 4 : fractionalPart)); | |
return Number(left + (fractionalPart !== 0 ? `.${right}` : ``)); | |
} | |
return Number(this); | |
} |
NewerOlder