PK
>QjAa3
index.html
Parcel Sandbox
PK
>QOa package.json{
"name": "vanilla",
"version": "1.0.0",
"description": "JavaScript example starter project",
"main": "index.html",
"scripts": {
"start": "parcel index.html --open",
"build": "parcel build index.html"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "7.2.0",
"parcel-bundler": "^1.6.1"
},
"keywords": [
"javascript",
"starter"
]
}PK
>Q src/PK
>Q TÅ src/letAndConst.js//const let != var
const tosinso = "hello tosinso";
if (true) {
const tosinso = "Bye tosinso";
}
console.log(tosinso);
PK
>Q9e src/arrowFunction.js// function sayHello() {
// console.log("hello");
// }
// const sayHello = function () {
// console.log("hello");
// };
function saySomething(sayFunction) {
console.log(sayFunction());
}
saySomething(() => {
return "hello";
});
PK
>Qg src/stringLiterals.js//String Literal
const name = "Parsa";
const hello = `Hello
${name}
!`; //"Hello " + name + " !";
console.log(hello);
PK
>Q! src/Destructuring.js//Destructuring Objects
const person = {
name: "Parsa",
age: 20,
height: 180
};
// const name = person.name
// const age = person.age
// const height = person.height
const { name, age, height } = person;
//console.log(name, age, height)
//Destructuring Arrays
const people = ["Parsa", "Ali", "Masood"];
//const parsa = people[0]
//const ali = people[1]
const [, ali] = people;
console.log(ali);
PK
>Qn_ _ src/index.jsimport firstName, { person as person1 } from "./exports";
console.log(firstName, person1);
PK
>Q+嗍 src/exports.jsconst person = {
name: "Ali",
age: 28
};
const name = "Parsa";
export { person };
export default name;
// export { name };
PK
>Q
.codesandbox/PK
>Qq .codesandbox/workspace.json{
"responsive-preview": {
"Mobile": [
320,
675
],
"Tablet": [
1024,
765
],
"Desktop": [
1400,
800
],
"Desktop HD": [
1920,
1080
]
}
}PK
>QjAa3
index.htmlPK
>QOa package.jsonPK
>Q src/PK
>Q TÅ src/letAndConst.jsPK
>Q9e b src/arrowFunction.jsPK
>Qg src/stringLiterals.jsPK
>Q! C src/Destructuring.jsPK
>Qn_ _ ' src/index.jsPK
>Q+嗍 src/exports.jsPK
>Q
i .codesandbox/PK
>Qq .codesandbox/workspace.jsonPK