vadim9999 / js

2 stars 0 forks source link

arrays practice #5

Open atherdon opened 6 years ago

atherdon commented 6 years ago

Move this files in current repository

vadim9999 commented 6 years ago

Как переместить файл в текущий репозиторий?

atherdon commented 6 years ago

1) open https://github.com/GroceriStar/groceristar 2) click Fork button 3) wait until fork will be done to your github account 4) git clone your version of groceristar repository 5) copy that files 6) paste to folder, related to this repo 7) git add * + git commit + git push

atherdon commented 6 years ago

ok, so what the progress of this task? is it completed and i can start your code review?

vadim9999 commented 6 years ago

I have moved files from groceristar in this repository. Copy and past arrays in separated files and replace departments[index].id on the department name. The task is completed.

atherdon commented 6 years ago

Ok, can you remove arrays from prev files and include them from separated files? @vadim9999

vadim9999 commented 6 years ago

@atherdon I have redone this task. If I make a modules data.js export function square(x) { console.log(x); return x * x; } //-------------------- mymodule.js import {square} from './data'; console.log(square(2)); //------------------ index.html

HTML

I can't see results of console.log(square(2)); How can I see it? In articles writes that needs module loader (SystemJS,RequireJS, stealjs and other)

atherdon commented 6 years ago

because you're using es6 syntax. try require(filepath) instead of import.

Second assessment -

atherdon commented 6 years ago

yeah - you tried to launch file that requires compilation before execution and also you run it without nodejs server but don't rush this- we;'ll get there

vadim9999 commented 6 years ago

@atherdon I need to delete departments.js and departmentsAttributes.js then leave departments.js? And in departments.js delete import statement and replace file extension from js into json? I have created in data folder Departments

atherdon commented 6 years ago

please extend your question. not very clear. for JSON: yes

On 04-Jul-2018 at 03:26 PM, Vadim wrote:

@atherdon https://github.com/atherdon I need to delete departments.js and departmentsAttributes.js then leave departments.js? And in departments.js delete import statement and replace file extension from js into json?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vadim9999/js/issues/5#issuecomment-402509424, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDqBdNYU2SQGAia6fSx5Mrt6V-zJdks5uDN6qgaJpZM4U_MWO .

vadim9999 commented 6 years ago

@atherdon I have cloned this repo https://github.com/GroceriStar/groceristar-fetch on my hdd. I've made tasks. What to do next? where to push this?

atherdon commented 6 years ago

push it on grocery-fetch repo :)

vadim9999 commented 6 years ago

@atherdon In project grocery-fetch the main file is index.js. In index.js function require() works like import modules. In arguments of require() is a path to json file. There are a function parser that retrieve data stored in folder "data". Also there are getters which returns arrays. I think it's application is a control of restaurant or other institution. Creating dishes considering allergies on food. Control count of food.

atherdon commented 6 years ago

@vadim9999 Good! ok, so right now data folder contains static information that we're using in our Search API server and at our Advanced Search Form(frontend part). as it has same code - i decide to move it to a separate place with good test coverage. But when you'll move data, related to Groceristar project - this package will have static data, related to our 3 projects. And it's necessary to keep logic separated, agree? So please take your time, and think about the step-by-step plan:

and please put this plan here, so i'll be able to review it, before we'll start an actual work

atherdon commented 6 years ago

btw, if terminology like git commit, git push is not clear - tell me. i'll create a separated course for git learning for you

vadim9999 commented 6 years ago

@atherdon I know this commands. When I tried to push on https://github.com/GroceriStar/groceristar-fetch It was denied access. I have fork and cloned this repo, made some work and excecute git add *. Then I have git commit -m "arrays". After that I git push https://github.com/vadim9999/groceristar-fetch

atherdon commented 6 years ago

please go to Pull Requests and create a pull request to main repository

vadim9999 commented 6 years ago

@atherdon Plan

  1. Add searching by recipes, ingredients, allergies with pop-up menu.

  2. Icons on each ingredients.

  3. Opportunity to share recipes with other people by facebook, twitter and other social networks.

  4. Add cloud storage or something.

atherdon commented 6 years ago

keep in mind that main cool feature of this plugin is simplicity. so it'll keep only static json files and maybe some wrappers.

for search form - we have a separated repo - i'll show it you soon.

basically, all your points are related to main our project. and it's cool, but for now, we need to focus on this small piece of code here.

vadim9999 commented 6 years ago

@atherdon Why in this code typeof returns object? I thought foo is an array var foo = ['Apple','Mango']; console.log(typeof foo);

atherdon commented 6 years ago

arrays and objects are same in JS. because their types are not strict.

On 09-Jul-2018 at 07:47 PM, Vadim wrote:

@atherdon https://github.com/atherdon Why in this code typeof returns object? I thought foo is an array var foo = ['Apple','Mango']; console.log(typeof foo);

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vadim9999/js/issues/5#issuecomment-403598283, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDnFNKqOk3tA2zDE5hkt1gF-rRzEoks5uE7NZgaJpZM4U_MWO .