Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Victor
@VictorHall
I need to reach that value in line 23
then in 32 it is condensed into values that both are arrays have in common
Tom
@moT01
i think youre going about it the wrong way, ...that's whats causing the problem
youre using too much memory or processor or whatever it is
creating and going through those huge loops is too much
Mitchell Stewart
@mitchstewart08
yeah
it's almost worse than O(n^2)
Tom
@moT01
i started with an array of the numbers in the range
Victor
@VictorHall
@mitchstewart08 lol i know its bad
@moT01 okay
ill give it another shot
Tom
@moT01
not that bad
it would work
if you had a super computer
maybe
Victor
@VictorHall
@moT01 thanks
CamperBot
@camperbot
victorhall sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: victorhall already gave mot01 points
Tom
@moT01
one way to maybe limit the loops performed would be to start a loop at all the numbers in the range multiplied by each other
i dont think i did that, but pretty sure it would work
wait, maybe not
something along those lines might help
John Nunns
@johnnunns
Any js experts on ?? :)
Tom
@moT01
im no expert, but i can try to help if you want
John Nunns
@johnnunns
@moT01 I'm on the Record Collection problem
And I'm struggling badly
quackidy
@quackidy
Thank you so much @dwquach and @khaduch
CamperBot
@camperbot
quackidy sends brownie points to @dwquach and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @dwquach |http://www.freecodecamp.com/dwquach
:star2: 2178 | @khaduch |http://www.freecodecamp.com/khaduch
Tom
@moT01
yea, can you be more specific at all? have any code to show?
Ken Haduch
@khaduch
@johnnunns - please post your code. It's not really too difficult once you get going in the right direction.
John Nunns
@johnnunns
function updateRecords(id, prop, value) {
  if(collection.tracks.hasOwnProperty()){
    return collection;
  }else if (collection.tracks.hasOwnProperty === false){
    collection.tracks.push
  }
It's very unfinished, I'm not sure if I'm headed in the right direction
Ken Haduch
@khaduch
@johnnunns - one question - does collection have a tracks property, ever? What kind of properties does collection have - the "first level" of properties. For that matter, what kind of structure is collection?
John Nunns
@johnnunns
I guess what you're telling me is that the tracks property belongs to the id which is the record number. correct?
so if I were going to push, it'd have to be collections.2548.tracks.push()
Ken Haduch
@khaduch
probably that's what I'm telling you, so if you have a collection, and an id, what would you do with that to try and find a tracks property? Your answer is close, but you have to make sure that you understand when you can use dot notation vs. bracket notation to access an object.
John Nunns
@johnnunns
alright. lets rework. Thanks @khaduch. mini lightbulb
CamperBot
@camperbot
johnnunns sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2179 | @khaduch |http://www.freecodecamp.com/khaduch
Tom
@moT01
say @khaduch, how my clock look?
http://codepen.io/moT01/pen/PbrzQo
John Nunns
@johnnunns
@khaduch
function updateRecords(id, prop, value) {
  if(collection["1245"].tracks.hasOwnProperty()){
    return collection;
  }else {
    collection['1245'].tracks.push("Don't know")
  }
Tom
@moT01
@johnnunns use the parameters, they will be different each time
Ken Haduch
@khaduch
@johnnunns - okay, that might work, but remember that you are getting different id values, and those values will be the numbers, so you should be able to use that variable in your data access.
Tom
@moT01
@johnnunns check out the syntax on the .hasownprop method
should be a link on that exercises page
John Nunns
@johnnunns
function updateRecords(id, prop, value) {
  if(collection["1245"].tracks.hasOwnProperty(prop)){
    return collection;
  }else {
    collection['1245'].tracks.push("Don't know");
  }
better?
Tom
@moT01
check out kens last message
1245 won't be 1245 every time