by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 20:09
    @krisb1220 banned @Gastony
  • May 14 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 22:38
    @bjorno43 banned @real-action
  • Feb 01 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 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
Markus Kiili
@Masd925
@iangracia Equal can mean many things.
CamperBot
@camperbot
masd925 sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 348 | @iangracia |http://www.freecodecamp.com/iangracia
Nickey Pickorita
@Pickorita
Hi, anyone online?
Ian Gracia
@iangracia
yeah
i also want to live in london
Nickey Pickorita
@Pickorita
@iangracia then move to london lol :D
CamperBot
@camperbot
pickorita sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @iangracia |http://www.freecodecamp.com/iangracia
Nickey Pickorita
@Pickorita
btw could anyone pm me please, I need quick help with CSS
Zerka1982
@Zerka1982
put your code in codepen
piteto
@piteto
Feel free to ask your question here @Pickorita plenty willing to help. If it's a lot of code, put it in a codepen or jsfiddle
Nickey Pickorita
@Pickorita
I can't put it in codepen
its quite large and in dreamweaver
There are just 3 elements that I need to align but I think I messed up something so its just aligning wrongly
anyone willing to check screenshots?
Ian Gracia
@iangracia
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) { 
  if (value=="") {
    delete collection[id][prop];
    return collection;
  }
  switch(prop) {
    case "tracks":
      if (collection.hasOwnProperty(prop)) {
        collection[id][prop].push(value);
      }
      else {collection[id][prop]= [value];}
      break;     
    default:
      collection[id][prop] = value;      
             }

  return collection.hasOwnProperty(prop);
}

// Alter values below to test your code
console.log(updateRecords(2468, "tracks", "Free"));
guys why is it returning false
when it obv should return true because 2468 has a property called tracks
no need to look at the whole code, just tell me why the returned boolean is false
Justine Diza
@JustineDiza
Hi! Does anyone here use UI Router? I have a problem with my code, been trying to find other solutions for about an hour now, help is pretty much appreciated!
wnghero
@wnghero
@iangracia heres how I did that problem
CamperBot
@camperbot
wnghero sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 350 | @iangracia |http://www.freecodecamp.com/iangracia
wnghero
@wnghero
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if(value !== "" && prop !== "tracks"){
    collection[id][prop] = value;
  }  else if(prop=="tracks"&&value!==""&&collection[id][prop]===undefined){
    collection[id][prop] = [];
    collection[id][prop].push(value);
  } else if(prop=="tracks"&&value!==""){
    collection[id][prop].push(value);
  } else if(value===""){
    delete collection[id][prop];
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "tracks", "Take a Chance on Me");
Ian Gracia
@iangracia
i found the problem
i was missing [id]
wnghero
@wnghero
ahhh
Ian Gracia
@iangracia
wrong : collection.hasOwnProperty(prop);
right: collection[id].hasOwnProperty(prop);
dont you just love coding? :coding:
:cry:
wnghero
@wnghero
lmao it sucks but the money thoooo
Ian Gracia
@iangracia
right? @wnghero
Sorin Ruse
@sorinr
@Pickorita do u have it some place where we can see it live?
Nickey Pickorita
@Pickorita
@sorinr yea, I will send you a dm
Justine Diza
@JustineDiza

@JustineDiza
Hi! Does anyone here use UI Router? I have a problem with my code, been trying to find other solutions for about an hour now, help is pretty much appreciated!
Here's my HTML base:

<ul class="formSteps uk-margin-large-top">
            <li ui-sref-active="active">
                <a ui-sref=".substep" class="removeLink">Basic Information</a>
            </li>
            <li ui-sref-active="active">
                <a ui-sref=".step_four" class="removeLink">Business Information</a>
            </li>
            <li ui-sref-active="active">
                <a ui-sref=".step_five" class="removeLink">Business Activity</a>
            </li>
            <li>
                <a class="removeLink">Documents</a>
            </li>
            <li>
                <a class="removeLink">Gallery</a>
            </li>
            <li>
                <a class="removeLink">Employee</a>
            </li>
            <li>
                Complete
            </li>
        </ul>

        <!-- Substeps for step1 go here -->
        <div ui-view="substep"></div>

<div class="br-form-container">
            <div class="page-header text-center">
                <!-- Our nested state views will be injected here -->
                <div ui-view></div>
            </div>
        </div>

Here's my route.js:

// Adding state for substeps
            .state('business_registration.substep', {
                url: '/1-sub',
                data: { activeTab: 'business'},
                controller: 'AccountBusinessController',
                params: {
                    businessType: null
                },
                controllerAs: 'abc',
                views: {
                    '': {
                        templateUrl: 'business/step1.html'
                    },
                    'substep@business_registration.substep': {
                        templateUrl: 'business/substep.html'
                    }
                }
            })

What I'm trying to do is to have 2 separate step progress counter, where the substep consists of substeps for different views, but it doesn't show up in the page.

Ian Gracia
@iangracia
var x = 0;

x += 1.01;
x += 2.05;

console.log(x);

//why does this equal 3.0599999999999996
//and not 3,06???
CamperBot
@camperbot
piteto sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 352 | @iangracia |http://www.freecodecamp.com/iangracia
Ian Gracia
@iangracia
@piteto thx, will study
CamperBot
@camperbot
iangracia sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 185 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
var x = 0;

x += 1.01;
x += 2.05;

console.log(Number(x.toFixed(2)));
// or
console.log(Number(parseFloat(x).toPrecision(12)));
Ian Gracia
@iangracia
can't belive simple math has to be so complicated
Dennis Daubney Jr
@MrOolong
Hi all, i'm trying to get my freecodecamp quote gen to post the quotes to twitter, but i'm currently stuck with the javascript. Could anyone take a look at my code and lend a hand?
Ian Gracia
@iangracia
@piteto why do you have to use parsefloat if the variables aren't strings?
i'm having a hard time wrapping my head around this simple problem
piteto
@piteto
@iangracia You don't have to in that example - it works with numbers or strings