Skip to content

Commit

Permalink
funcion para obtener la información de un item dada la marca #43
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelfdez99 committed Dec 8, 2020
1 parent 877901f commit fb7bcbe
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions functions/getBrand.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@ const data = require('./data.json');
function gBrand(b){
item = "";
for(i = 1; i <= 6; i++){
type = "";
size = ""
if (data['items'][i]["brand"] == b){
if (data['items'][i]["type"].length > 0){
for( j = 0; j < data['items'][i]["type"].length; j++){
type += "\n Type: " + data['items'][i]["type"][j] +
"\n Size: " + data['items'][i]["size"][j];
}
}
else{
type += "\n Type: " + data['items'][i]["type"] +
"\n Size: " + data['items'][i]["size"];
}
item += data['items'][i]["brand"] + ":" + type + "\n";
}
item += "\n Type:" + data['items'][i]["type"][i] +
"\n Size: " + data['items'][i]["size"][i] +
"\n Color: " + data['items'][i]["color"][i] +
"\n Price: " + data['items'][i]["price"][i] +
"\n Season: " + data['items'][i]["season"][i] "";
}
return item;
}
Expand Down

1 comment on commit fb7bcbe

@vercel
Copy link

@vercel vercel bot commented on fb7bcbe Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.