This file contains hidden or 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
| /** | |
| * Filters an array of objects using custom predicates. | |
| * | |
| * @param {Array} array: the array to filter | |
| * @param {Object} filters: an object with the filter criteria | |
| * @return {Array} | |
| */ | |
| function filterArray(array, filters) { | |
| const filterKeys = Object.keys(filters); | |
| return array.filter(item => { |
This file contains hidden or 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
| - a ํ๊ทธ์ target attibute๋ง ์ ํ | |
| a[target] { | |
| background-color: yellow; | |
| } | |
| - title attibute ์ flower value๊ฐ๋ง ์ ํ | |
| [title~=flower] { | |
| border: 5px solid yellow; | |
| } |
This file contains hidden or 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
| 1. IOS - css ๋ก ์์ ํ๋ฉด? | |
| -webkit-tap-highlight-color: | |
| 2. ์๋๋ก์ด๋์ ๊ฐ์ด ์์ ํ๋ ค๋ฉด ? | |
| - a:active ์ ์ฉ | |
| - ์คํ๊ฒฐ๊ณผ ์์ดํจ๋์์๋ a:hover , a:active๊ฐ ๊ฐ์ด ์ ์ฉ๋๋ค. | |
| - button ์ ์ฉ : https://codepen.io/Tkashiro/full/EaVVxr | |
| the best way to order your pseudo-class styles are :hover then :focus then :active . |
This file contains hidden or 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
| 1. ForEach | |
| let btns = document.querySelectorAll('button'); | |
| btns.forEach(function (i) { | |
| i.addEventListener('click', function() { | |
| console.log(i); | |
| }); | |
| }); |
This file contains hidden or 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
| button { | |
| width: 160px; | |
| height: 40px; | |
| font-size: 15px; | |
| letter-spacing: -1px; | |
| line-height: 21px; | |
| color: #2a5081; | |
| vertical-align: middle; | |
| } |
This file contains hidden or 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
| return code || '' | |
| code ๊ฐ true ์ด๋ฉด code ์ถ๋ ฅ ์๋๋ฉด '' (๋น์นธ์ถ๋ ฅ) | |
| ์ด๋ด๋ code๊ฐ false ์ผ ๊ฒฝ์ฐ๋ ์๋์ ๊ฐ๋ค | |
| Examples of expressions that can be converted to false are: | |
| null; | |
| NaN; | |
| 0; | |
| empty string ("" or '' or ``); |
This file contains hidden or 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
| https://javascript.info/onload-ondomcontentloaded |
This file contains hidden or 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
| var book = { | |
| title:"๊ฐ์ฒด์งํฅ ์๋ฐ์คํฌ๋ฆฝํธ" | |
| } | |
| var message = "Book = " + book; | |
| console.log(book.toString()) | |
| console.log(message) // "Book = [object Object]" | |
| console.log(Object.prototype.toString.call(book)) | |
| var book2 = { | |
| title:"๊ฐ์ฒด์งํฅ ์๋ฐ์คํฌ๋ฆฝํธ", |
This file contains hidden or 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
| 1. DocumentFragments are DOM Node objects which are never part of the main DOM tree. | |
| var ul = document.getElementById("ul_test"); | |
| // First. add a document fragment: | |
| #javascript | |
| (function() { |
This file contains hidden or 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
| display: -webkit-box; -webkit-line-clamp: 2; | |
| -webkit-box-orient: vertical; | |
| overflow: hidden; | |
| text-overflow: ellipsis; |
NewerOlder