React? Vue? ?? ????? ?????? ?? ???? ?? ??? Virtual DOM??? ??? ???? ????. Virtual DOM? DOM ????? ?? ????? ??? ? ?? ??? ??? ? ??? ?? ??? ?????.
? ?????? ???? ??? ??? ??? ???? ???? ??? ?? DOM? ???? ??? ??? ?????.
?? DOM?? ??????
Virtual DOM? ?? DOM(? ??? ??)? ??? ??? ??? ??? ????. (??) ?? DOM? ?? ?????? ??, ?? Virtual DOM? ???? ??? ?????? ??? ?? ?? DOM?? ????? ??? ??? ???????. ??? ?? ??? ???? ?? ? ?????!
1??: ?? DOM? ??? ??
? ???? ??? ??? ??? ???. ??? ? ??(?:
??
)? ??? '??'???. ?? DOM ??? ??? ?? ? ??? ???? ?? ?????.
?:
Virtual DOM Node: { type: 'div', props: { id: 'container' }, // attributes like id, class, etc. children: [ // children inside this element { type: 'p', // a <p> tag (paragraph) props: {}, children: ['Hello, world!'] // text inside the <p> tag } ] }
"Hello, world!".
???? ?? ???? ???:
- ? ???? ??(?: div, p)? ????.
- props(id, class ?)? ?? ? ????.
- ?? ??? ???? ? ? ?? ?? ??? ????.
2??: ?? DOM? ?? DOM?? ???
?? ?? DOM? ???? ?? ???? ?? HTML? ??? ? ?? ??? ?????.
?? DOM ??? ??? ?? HTML ??? ???? render?? ??? ??? ?????.
function render(vNode) { // 1. Create a real element based on the Virtual DOM type (e.g., div, p). const element = document.createElement(vNode.type); // 2. Apply any attributes (props) like id, class, etc. for (const [key, value] of Object.entries(vNode.props)) { element.setAttribute(key, value); } // 3. Process the children of this Virtual DOM node. vNode.children.forEach(child => { if (typeof child === 'string') { // If the child is just text, create a text node. element.appendChild(document.createTextNode(child)); } else { // If the child is another Virtual DOM node, recursively render it. element.appendChild(render(child)); } }); return element; // Return the real DOM element. }
??? ?? ?? ??????
- ??(document.createElement(vNode.type))? ?????.
- ID, ??? ?? ?? ??? ?????.
- ? ?? ??? ???? ????? ?? ???? ???? ?? ??(??? ?? ?? ??)? ?????.
3??: ?? ?? DOM? ? ?? DOM ??(??)
? ??? ??? ????(?: ???? ??? ???) ??? ?? DOM? ????. ??? ?? DOM? ?????? ?? ?? ?? DOM? ? ?? DOM? ???? ??? ?????? ???? ???. ?? '??'?? ???.
? ?? DOM? ???? ??? ??? ?????.
Virtual DOM Node: { type: 'div', props: { id: 'container' }, // attributes like id, class, etc. children: [ // children inside this element { type: 'p', // a <p> tag (paragraph) props: {}, children: ['Hello, world!'] // text inside the <p> tag } ] }
?? ?? ??:
-
?? ?? ??: ?? ??? ????(?: ?
? ??) ?? ???? ?????.
- ??? ??: ?? ???? ???? ???? ???????.
- ?? ? ??: ??? ??(props) ?? ?? ??? ?????? ?????.
4??: Real DOM ??
??? ??? ?? ?? ?? ?? ??? ?? DOM? ???? ???. ??? ? ??? ???? ????.
?? ??? ??? ????.
function render(vNode) { // 1. Create a real element based on the Virtual DOM type (e.g., div, p). const element = document.createElement(vNode.type); // 2. Apply any attributes (props) like id, class, etc. for (const [key, value] of Object.entries(vNode.props)) { element.setAttribute(key, value); } // 3. Process the children of this Virtual DOM node. vNode.children.forEach(child => { if (typeof child === 'string') { // If the child is just text, create a text node. element.appendChild(document.createTextNode(child)); } else { // If the child is another Virtual DOM node, recursively render it. element.appendChild(render(child)); } }); return element; // Return the real DOM element. }
?? ??:
- ??: ? ??? ?? ??? ??? ?????.
- ???: ?? ??? ???? ???????.
- ????: ?? ??? ?? ??? ?? ??? ???????.
?? DOM ???? ??:
- ?? DOM ??: ?????? ??? ?? ??? ???? ??? ?? ??? ????.
- ?? DOM?? ???: ? ?? DOM? ?? HTML ??? ???? ???? ?????.
- ?? ????: ??? ???? ?? ?? DOM? ? ?? DOM? ???? ???? ????.
- ?? DOM ??: ??? ?? ???? ???? ?? ??? ?? DOM? ?????.
?? ??
Virtual DOM? ?? DOM? ?? ???? ??? ?? ??? ?????? ? ??? ????? ? ?? ??? ?????. Virtual DOM? ?????? ? ?? ??? ?????? ????? ??? ????? ? ??? ??? ??? ??? ??? ? ????.
??? Virtual DOM ??? ?? ????? ?? React? ?? ?????? ?? ??? ????? ??? ? ?? ??? ?????!
? ??? ???? ?? DOM ??: ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

.map (), .filter () ? .reduce ()? ?? JavaScript ?? ?? ???? ??? ??? ??? ? ? ????. 1) .map ()? ??? ??? ??? ???? ? ??? ???? ? ?????. 2) .filter ()? ???? ??? ????? ? ?????. 3) .reduce ()? ???? ?? ??? ???? ? ?????. ???? ??? ????? ??? ?? ?? ??? ?????.

JavaScript? ??? ??? ?? ??, ? ? ? ?? ???? ???? ??? ??? ?????. 1. ?? ??? ?? ??? ???? ??? ??? ??? ??? ?? WebAPI? ?????. 2. WebAPI? ??????? ??? ?? ? ? ??? ?? ??? (??? ?? ?? ???? ??)? ????. 3. ??? ??? ?? ??? ?? ??? ?????. ?? ??? ??? ????? ??? ??? ?? ? ???? ?????. 4. ???? ?? (? : Promise. 5. ??? ??? ???? ?? ???? ???? ?? ?? ?? ??? ????? ? ??????.
