## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### Activity
Lily Romano
@Lilyheart
Oh that is an interesting way to solve!
David Castner
@davidjcastner
I'm having lunch right now, but you can simplify that even more by using Array.map I'll post that after I eat
Lily Romano
@Lilyheart
Here is how I did it. I am bad at commenting sometimes
function steamrollArray(arr) {
var flatArr = [];
for (var i = 0; i < arr.length; i++) {
if (Array.isArray(arr[i])) {
var tempArr = steamrollArray(arr[i]);
for (var j = 0; j < tempArr.length; j++) {
flatArr.push(tempArr[j]);
}
} else {
flatArr.push(arr[i]);
}
}

return flatArr;
}
kevincauto
@kevincauto
Nice!
David Castner
@davidjcastner
// here is how to do it with Array.map
function steamrollArray(arr) {
var answer = [];
var flatten = function(element) {
if (Array.isArray(element)) {
element.map(flatten);
} else {
}
};
flatten(arr);
}
Mike
@dcpking
Slowly working through the BootCamp (for my sins!). Inputs of type date and password are new to me, and placeholders, and also the checking in the button on the form to see if you entered valid dates, etc. I used to have to write JavaScript to validate those!!
Jonathan Herman
@lantech19446
If i learn anything from @davidjcastner it damn well better be commenting my code lol.
Mike
@dcpking
@lantech19446 You're not writing in C now, Jonathan (C == "Write-Only Code")
David Castner
@davidjcastner
@lantech19446 I appreciate the compliment, since if there's anything that I teach to people writing code, it would how to write clean & clear code
Robert Maylie
@rmaylie9560
I definitely wouldn't of thought of writing that method recusively. Although I do try to keep variable scope as small as possible.
Lily Romano
@Lilyheart
Whenever you don't know how deep you will need to go, it is pretty much needed.
Robert Maylie
@rmaylie9560
Can you explain?
Lily Romano
@Lilyheart
Sure! In steamroll, if you didn't have the test cases, you'd have no idea how far deep the arrays go. Maybe 2, Maybe 12. Like in factorial, you may only be doing ^6 or ^106. When writing the code, you don't know how deep you will need to go. Factorial you could for loop, but in steamroll not so much as in factorial you know from the onset how many. But in steamroll, until the code fully dissects the array, you'd never know how many dimensions the array has.
Hopefully that makes sense. Sleep was not so grand.
Robert Maylie
@rmaylie9560
Perfect sense, thank you.
Lily Romano
@Lilyheart
This won't stay running forever, but here is where I'm at in Colt Steele's bootcamp. Registration works (have to register before adding campgrounds or comments). Registration was just added so some things still need tweaking (e.g. author on comment add form). Other things don't work yet and just have placeholders, so no fussin' about that :p Overall really enjoying this. https://colt-steele-bootcamp-lilyheart.c9users.io/campgrounds
David Castner
@davidjcastner
@Lilyheart what are you using for user accounts? I'm curious
Lily Romano
@Lilyheart
You can see ALL the code in the github [Yes, I know even secrets are listed, I'm not really worried about it for this application... and regardless of that, the secret that is pushed isn't the same as the live one anyway :p )
can you create a user and poke around if you wish
David Castner
@davidjcastner
nice, I'll have to look into it
Lily Romano
@Lilyheart
When someone's Facebook account is 5 hours old, I am hesitant to approve...
David Castner
@davidjcastner
Lily Romano
@Lilyheart
@davidjcastner earlier today. I PMd you a link as I don't wanna call anyone out publicly.
Robert Maylie
@rmaylie9560
Note to self: pickles eventually go bad. Fight the temptation.
-that is all.
Lily Romano
@Lilyheart
did they join a pickle gang?
Robert Maylie
@rmaylie9560
They did! nothing worse than a pack of unruley pickled cucumbers causing trouble in the fridge.
Jonathan Herman
@lantech19446
Pickles only go bad if they aren't fully submerged in brine otherwise it's impossible for the bacterium necessary to spoil them to exist. L. Bacillus bacteria are anaerobic the others aren't.
Lily Romano
@Lilyheart
After a long while, the pickles, even fully submerged, can become… un-tasty. Submerging them will ensure they “live” as long as possible tho!
Jonathan Herman
@lantech19446
Possibly untasty because the salt in the brine may eventually become fully absorbed into the cucumber it just wont spoil lol. All this is making
Me want to start a batch of kraut thoug
Lily Romano
@Lilyheart
... Now I want pickles... I wonder if mine have gone bad. I bought them so long ago.
Jonathan Herman
@lantech19446
why do you buy them when cucumbers are so cheap?
Lily Romano
@Lilyheart
Because I have a skin condition where I avoid water whenever possible.
Making things is problematic.
Jonathan Herman
@lantech19446
does vinegar effect you too or just the water?
Lily Romano
@Lilyheart
vinegar on my hands would need to be washed off.
cooking in general requires washed hands.
Jonathan Herman
@lantech19446
would be hard to wear gloves for it too since plastic can inhibit the fermentation
Lily Romano
@Lilyheart
gloves makes for sweaty hands after awhile. You don't realize it until you have to avoid water. In fact the skin condition is "bad sweating" eczema in latin.
Don't look it up, it looks gross :p I have a small breakout right now and it's a burning pain in the ... um... hand.
I skip my cream after one shower... aghghghghhg. I hate the humid time of year.
Jonathan Herman
@lantech19446
I might still look it up lol things like that interest me especially the nutritional aspect of it like people with urticaria who are nutrient deficient and able to get off all their meds plugging in that one hole that could be some trace mineral like selenium because they don't like nuts or something
Lily Romano
@Lilyheart
That's my other skin condition, but we've already talked about that because of Joe Cross. Dermagraphia... It's better when I cut out wheat, but by better I mean I still have it but it doesn't burn like Hades.
Jonathan Herman
@lantech19446
yea
I'm working to become reobsessed with this stuff again, found out yesterday I have hypertension again as well as edema and possibly sleep apnea
Lily Romano
@Lilyheart
All the diet changes I made working through the dermagraphia didn't do a thing for the dyshidrosis. I have the dermagraphia at some stasis point where just an allergy pill and it's no issue (unless stress level creep into the equation).
Jonathan Herman
@lantech19446
honestly it wouldn't suprise me at all if you had competing conditions where making one thing better makes the other worse\