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
{ | |
"name": "ts-torrent", | |
"version": "0.1.0", | |
"private": true, | |
"main": "./electron/main.js", | |
"homepage": "./", | |
"dependencies": { | |
"@testing-library/jest-dom": "^5.11.4", | |
"@testing-library/react": "^11.1.0", | |
"@testing-library/user-event": "^12.1.10", |
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
function App() { | |
return ( | |
<div className="App"> | |
{/*<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<p> | |
Edit <code>src/App.js</code> and save to reload. | |
</p> | |
<a | |
className="App-link" |
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
/* | |
./electron/main.js | |
*/ | |
const { app, BrowserWindow } = require('electron'); | |
const isDev = require('electron-is-dev'); | |
const path = require('path'); | |
let mainWindow; |
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 employSalaryMap1 = new Map(); | |
employSalaryMap1.set('Mike', 5000); | |
employSalaryMap1.set('Nancy', 6000); | |
employSalaryMap1.set('Kim', 6600); | |
let employSalaryMap2 = new Map(); | |
employSalaryMap2.set('Sam', 5000); | |
employSalaryMap2.set('John', 6000); | |
employSalaryMap2.set('Kim', 74000); |
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 array = [['Mike', 5000],['Nancy', 6000], ['Kim', 6600]]; | |
let map = new Map(array); | |
console.log('map', map); | |
//map Map { 'Mike' => 5000, 'Nancy' => 6000, 'Kim' => 6600 } |
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 employSalaryMap = new Map(); | |
employSalaryMap.set('Mike', 5000); | |
employSalaryMap.set('Nancy', 6000); | |
employSalaryMap.set('Kim', 6600); | |
let array = [...employSalaryMap]; | |
console.log('array', array); | |
//array [ [ 'Mike', 5000 ], [ 'Nancy', 6000 ], [ 'Kim', 6600 ] ] | |
console.log('array', array[0]); | |
//array [ 'Mike', 5000 ] |
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 employSalaryMap = new Map(); | |
employSalaryMap.set('Mike', 5000); | |
employSalaryMap.set('Nancy', 6000); | |
employSalaryMap.set('Kim', 6600); | |
for([key, value] of employSalaryMap){ | |
console.log('[key, value]', key, value); | |
} | |
//[key, value] Mike 5000 | |
//[key, value] Nancy 6000 |
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 employSalaryMap = new Map(); | |
employSalaryMap.set('Mike', 5000); | |
employSalaryMap.set('Nancy', 6000); | |
employSalaryMap.set('Kim', 6600); | |
let values = employSalaryMap.values(); //returns map iterator; | |
console.log(values[0]); // undefined | |
for(value of values){ | |
console.log('value', value); | |
} |
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 employSalaryMap = new Map(); | |
employSalaryMap.set('Mike', 5000); | |
employSalaryMap.set('Nancy', 6000); | |
employSalaryMap.set('Kim', 6600); | |
let keys = employSalaryMap.keys(); //returns map iterator; | |
console.log(keys[0]); | |
// undefined | |
for(key of keys){ | |
console.log('key', 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
const employeeSalaryObject = {Mary:5000, John:6000, Bill:3000}; | |
delete employeeSalaryObject['Mary']; | |
//this will remove Mary:500 from the object. But this is not safe way. |