show dbs
| /** | |
| * Ask: Update the App component so the <h2> element gets a color | |
| * from the COLORS array. Clicking on the Next button should cycle through the colors. | |
| * | |
| * Example: It should be initially blue, then red, ..., cyan, and then blue again. | |
| */ | |
| import ReactDOM from "react-dom"; | |
| // import { useState } from "react"; | |
| const COLORS = ["blue", "red", "green", "yellow", "black", "cyan"]; |
| /** | |
| * | |
| * ΠΠΠ’Π’ΠΠ Π ΠΠ ΠΠ‘ΠΠΠ‘ΠΠΠΠΠΠΠ¦/ΠΠΠΠΠΠΠΠ‘ (Flyweight) | |
| * | |
| * ΠΠ°ΡΡΠ΅ΡΠ½ ΠΠ ΠΠ‘ΠΠΠ‘ΠΠΠΠΠΠΠ¦/ΠΠΠΠΠΠΠΠ‘ - ΡΡΡΡΠΊΡΡΡΠ½ΡΠΉ ΡΠ°Π±Π»ΠΎΠ½ ΠΏΡΠΎΠ΅ΠΊΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΠΏΡΠΈ ΠΊΠΎΡΠΎΡΠΎΠΌ ΠΎΠ±ΡΠ΅ΠΊΡ, ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΡΡΠΈΠΉ ΡΠ΅Π±Ρ ΠΊΠ°ΠΊ | |
| * ΡΠ½ΠΈΠΊΠ°Π»ΡΠ½ΡΠΉ ΡΠΊΠ·Π΅ΠΌΠΏΠ»ΡΡ Π² ΡΠ°Π·Π½ΡΡ ΠΌΠ΅ΡΡΠ°Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, ΠΏΠΎ ΡΠ°ΠΊΡΡ Π½Π΅ ΡΠ²Π»ΡΠ΅ΡΡΡ ΡΠ°ΠΊΠΎΠ²ΡΠΌ. | |
| * ΠΠ°Π½Π½ΡΠΉ ΠΏΠ°ΡΡΠ΅ΡΠ½ ΠΏΡΠΎΠ΅ΠΊΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ Π²ΠΌΠ΅ΡΡΠΈΡΡ Π±ΠΎΠ»ΡΡΠ΅Π΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² Π² ΠΎΡΠ²Π΅Π΄ΡΠ½Π½ΡΡ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠ²Π½ΡΡ ΠΏΠ°ΠΌΡΡΡ. | |
| * ΠΠ΅Π³ΠΊΠΎΠ²Π΅Ρ ΡΠΊΠΎΠ½ΠΎΠΌΠΈΡ ΠΏΠ°ΠΌΡΡΡ, ΡΠ°Π·Π΄Π΅Π»ΡΡ ΠΎΠ±ΡΠ΅Π΅ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΌΠ΅ΠΆΠ΄Ρ ΡΠΎΠ±ΠΎΠΉ, Π²ΠΌΠ΅ΡΡΠΎ Ρ ΡΠ°Π½Π΅Π½ΠΈΡ ΠΎΠ΄ΠΈΠ½Π°ΠΊΠΎΠ²ΡΡ Π΄Π°Π½Π½ΡΡ Π² | |
| * ΠΊΠ°ΠΆΠ΄ΠΎΠΌ ΠΎΠ±ΡΠ΅ΠΊΡΠ΅. |
With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.
This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.
If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!
Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
| // connect() is a function that injects Redux-related props into your component. | |
| // You can inject data and callbacks that change that data by dispatching actions. | |
| function connect(mapStateToProps, mapDispatchToProps) { | |
| // It lets us inject component as the last step so people can use it as a decorator. | |
| // Generally you don't need to worry about it. | |
| return function (WrappedComponent) { | |
| // It returns a component | |
| return class extends React.Component { | |
| render() { | |
| return ( |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
| uv_run | |
| - uv__update_time(): Update time with millisecond precision. | |
| - uv__run_timers(): Loop through "heap" and run timers whose timeout > time. | |
| - uv__run_pending(): Run all callbacks on the pending_queue. Remove each item | |
| from the queue when run. |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
