Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
saulirajala committed Sep 15, 2019
1 parent f4c7324 commit 8a926af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Nyt mennään modernin JavaSriptin muotisanoihin eli niihin yleisiin termeihin,
- Eli sama engine mikä tulkitsee JS-koodia, tulkitsee sitä myös nodessa
- keino suorittaa JS-koodia palvelimella (ei selaimessa)
- globaali objekti on nyt eri => `node node-global.js`
- esim. `node by-value-by-reference.js` toimii kuten ko. tiedoston ajaisi selaimessa
- esim. `node weird-objects.js` toimii kuten ko. tiedoston ajaisi selaimessa
- ei `window`

## NPM
Expand Down Expand Up @@ -168,8 +168,7 @@ if (name == "Sale") {
### Installation and configuration

1. Asenna tarvittavat npm paketit:
`npm install --save-dev @babel/core @babel/cli @babel/preset-env webpack webpack-cli babel-loader prettier eslint eslint-config-prettier`
`npm install [email protected]`
`npm install [email protected] && npm install --save-dev @babel/core @babel/cli @babel/preset-env webpack webpack-cli babel-loader prettier eslint eslint-config-prettier`

2. Lisää tarvittavat konfiguraatio tiedostot
a) `.babelrc`: kerrot Babelille mitä plugareita/presettejä sen pitää käyttää
Expand All @@ -186,6 +185,7 @@ if (name == "Sale") {
scripts: {
"watch": "npx webpack --watch",
"dev": "npx webpack --mode development",
"build": "npx webpack --mode production",
}
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'core-js';
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
import Human from './Human';

const name = "Sale";
const name = "Kekkonen";
const age = 34;

// Shorthand objects
Expand Down
2 changes: 1 addition & 1 deletion variable-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ if (true) {
}
console.log(varName);
// console.log(letName); // Uncaught ReferenceError: letName is not defined
// const constName;
// console.log(constName); // Real error, no more undefined 🎉
// const constName;

// let, if value change. const, if not
// Tip: always const, let if needed
Expand Down
2 changes: 1 addition & 1 deletion wtf-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var myObj = {
};
myObj.myMethod();

console.log(myObj.arrowFunc());
console.log(myObj.arrowFunc(5)); // 10


(
Expand Down

0 comments on commit 8a926af

Please sign in to comment.