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
DOWNLAOD WEBSITE USING WGET | |
If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the job done. RUn the following commands in terminal. | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ |
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
#### DEEP COPY AN OBJECT | |
```js | |
var copiedObj = JSON.parse(JSON.stringify(obj)); | |
``` | |
Explanation: In JavaScript objects, copying an object variable results in copying only the reference to the same object. Hence, any changes to its embedded key-pair values result in changes made to the original object variable as well. | |
```js |
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
####DEEP COPY AN OBJECT | |
```js | |
var copiedObj = JSON.parse(JSON.stringify(obj)); | |
``` | |
Explanation: In JavaScript objects, copying an object variable results in copying only the reference to the same object. Hence, any changes to its embedded key-pair values result in changes made to the original object variable as well. | |
```js |
NewerOlder