Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 2019 18:04
    thecodingaviator closed #31157
  • Apr 01 2019 18:04
    thecodingaviator closed #33788
  • Apr 01 2019 18:04
    thecodingaviator commented #33788
  • Apr 01 2019 18:02
    thecodingaviator closed #31059
Elijah White
@elijahwhite97
i start with a function() that has a (variable/argument) then i have an if/else statement that calls a method() that uses the same (var/arg) that the function() is built with. . . .like what is this that is happening :laughing:
Joseph
@revisualize

@elijahwhite97 So you have a function declaration of function checkObj(checkProp) { } .. With that function declaration you have a function name of checkObj and you have a parameter of checkProp.
Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).
So, when you make a function call:
checkObj("pet") ... the parameter checkProp gets the value of the argument "pet".
checkObj("horse") ... the parameter checkProp gets the value of the argument "horse".
As mentioned above, you can then use the parameter inside of the function just like you'd use any other variable that holds a value.
Now, the lesson is trying to teach you about the object method .hasOwnProperty()

The hasOwnProperty() method returns a boolean (true/false) indicating whether the object has the specified property as own (not inherited) property.

Note: If conditions work on boolean (true/false) values.

edyoonn
@edyoonn
regarding "Stand in Line" do we have to run a for loop?
Manish Giri
@Manish-Giri
@edyoonn nope
you just add to the end, and remove from the front.
edyoonn
@edyoonn
@Manish-Giri what do you mean?
Aizaz Shahid
@aizazshahid
@edyoonn use .push() and .shift()
Manish Giri
@Manish-Giri
@edyoonn add item to the end of the array, then remove & return it's first element.
that's all.
Leonardo de Melo
@Leonardo-demeloweb

guys I am stucked a .js basics "Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed."

```

Manish Giri
@Manish-Giri
@Leonardo-demeloweb post your code.
Leonardo de Melo
@Leonardo-demeloweb
guys I am stucked a .js basics "Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed."

function nextInLine(arr, item) {
  // Your code here

  arr = [1,3,5,7,9];
  item = 13;

  //to append data to the end of the arr []
  nextInLine.push([11]);

  nextInLine = ourArray.shift();

  // to return the element that was removed, the first item of the array[0]
  return arr([0]);



}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Aizaz Shahid
@aizazshahid
@Leonardo-demeloweb you have to use the parameter arr and item
Manish Giri
@Manish-Giri
@Leonardo-demeloweb code is wrong.
Aizaz Shahid
@aizazshahid
don't need to create your self already testArr array is created for you that is passed as an argument
Manish Giri
@Manish-Giri
don't redefine the variables
Jason Luboff
@JLuboff
@Manish-Giri Your code is wrong
Joseph
@revisualize
@Leonardo-demeloweb Why are you overwriting the parameters?
THEcoder60
@THEcoder60
@Manish-Giri girl what happen to chat photos?
Aizaz Shahid
@aizazshahid
but you have to use the parameters to access that array !
@Leonardo-demeloweb
Manish Giri
@Manish-Giri
"girl"?
Leonardo de Melo
@Leonardo-demeloweb
@Manish-Giri probably i know, thats why i found myself stucked
Jason Luboff
@JLuboff
@Manish-Giri You're a girl now, didn't you know?
Manish Giri
@Manish-Giri
um, come again?
@Leonardo-demeloweb try to do the JS lessons on codeacademy first.
Jason Luboff
@JLuboff
@Manish-Giri I'm just messing around. I don't know about the others
Joseph
@revisualize

@Leonardo-demeloweb
Stand In Line is a CheckPoint where you're supposed to:
Write a function nextInLine which has two parameters
an array (arr) and a number (item).
That part has been done for you here:

function nextInLine(arr, item) { }

With that function declaration you have a function name of nextInLine.
You have two parameters arr which represents an array passed into the function and item that represents a number passed to the function.

Leonardo de Melo
@Leonardo-demeloweb
@Manish-Giri and what?
Keon Samuel
@keonsam
anyone knows what is error ReactBootstrap is undefined?
Joseph
@revisualize
@Leonardo-demeloweb Parameters are treated like variables that represent the values that get passed into your function from the function call (arguments).
Emmanx
@Emmanx
please i need help with the profile lookup challenge in the basic JS section
Manish Giri
@Manish-Giri
@Leonardo-demeloweb they'll help you get comfy with the basics first.
//to append data to the end of the arr []
  nextInLine.push([11]);

  nextInLine = ourArray.shift();
Joseph
@revisualize

@Leonardo-demeloweb A few example function calls:

nextInLine([4,3,2] , 1) the values passed to arr is [4,3,2] and the value passed to item is 1

nextInLine([2,4,6,8] , 10) ... arr is [2,4,6,8] & item is 10

nextInLine([2,3,5,7,11] , 13) ... arr is [2,3,5,7,11] & item is 13 (first 5 and 6th prime numbers)

nextInLine([] , 0) ... arr is [] & item is 0

var myArr = [1,3,5,7]; nextInLine(myArr , 9) ... arr is [1,3,5,7] a copy of the value of the global variable myArr & item is 9

Manish Giri
@Manish-Giri
you'll know why that code is wrong
@Leonardo-demeloweb
Will Foster
@Will5592
Am I right in thinking the Roman Numeral Converter will include an absolute ton of code (and lots of vars)???
Leonardo de Melo
@Leonardo-demeloweb
@Manish-Giri try to help somebody else, thankyou
CamperBot
@camperbot
leonardo-demeloweb sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 5498 | @manish-giri |http://www.freecodecamp.com/manish-giri
Joseph
@revisualize

@Leonardo-demeloweb So by you doing this:

  arr = [1,3,5,7,9];
  item = 13;

inside of your function.. You're basically overwriting the values of the parameters.

Jason Luboff
@JLuboff
@Will5592 All depends on how you do it...but...shouldn't be too many
Emmanx
@Emmanx
@Leonardo-demeloweb how did you get your in that image into the chat like that
Joseph
@revisualize

@Leonardo-demeloweb Also,

  nextInLine.push([11]);
  nextInLine = ourArray.shift();

Next in line is not an array. It is a function. And oldArray was never declared in your code anywhere ... So.. That really shouldn't be there.

Stephen James
@sjames1958gm
@keonsam You are probably not loading a file or not loading it in the right order
Joseph
@revisualize
@Leonardo-demeloweb I kind of feel like I'm just talking to myself over here.
Manish Giri
@Manish-Giri
@Leonardo-demeloweb yeah, I guess I'll help others who aren't pricks.
Leonardo de Melo
@Leonardo-demeloweb
@revisualize thanks to strive to help me, I am reviewing the lessons that i had already passed. But i am could not find the way yet.
CamperBot
@camperbot
leonardo-demeloweb sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles: