Where communities thrive


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

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
CamperBot
@camperbot
:star2: 1021 | @adityaparab |http://www.freecodecamp.com/adityaparab
NachumOlman
@NachumOlman
@Doug-Luce thanks that helped!
Douglas Luce
@Doug-Luce
@NachumOlman No problem
Darth Skywalker
@adityaparab
@julianmnst : .map returns an array of the elements returned from the call back function that is passed to the .map
so you iterate over arr1, that passes each element of arr1 to your function as item.
Along with item, .map also passes index of item. You use this index to query arr2 and arr3.
like arr2[item] and arr3[item] to get elements from arr2 and arr3 at the same index.
NachumOlman
@NachumOlman
thanks @Doug-Luce
CamperBot
@camperbot
nachumolman sends brownie points to @doug-luce :sparkles: :thumbsup: :sparkles:
:cookie: 369 | @doug-luce |http://www.freecodecamp.com/doug-luce
Darth Skywalker
@adityaparab
You contact them to your item
Jean-Paul Sauve
@jp-sauve

success function not passing anything to json2 I think. Any ideas on how to access inner success function's object?

https://codepen.io/sevensixtwo762/pen/vmKaPz?editors=1111

$(document).ready(function() {
  var auth="";
  $('#quothMore').on("click", function() {
    $.ajax({type:'GET',
            dataType:'json',
            url:'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
            success: function(json){
              var html="";
              auth = json[0].title;
              html += "<div class='quotes'>";
              html += json[0].content + "<p class='authorName'>-- " + auth + "</p>";
              html += "</div>";
              $("#rcol").html(html);
              console.log("auth variable set to: "+auth);
              var myURL = 'https://www.googleapis.com/customsearch/v1?q='+(encodeURIComponent(auth))+'&num=1&imgType=face&safe=high&searchType=image&fields=items(link,snippet)&cx=016785142417644725210:ecuzg4lxswe&key=AIzaSyC2ntpD3H9RQuRcD2SyrN4GX38kI1IMcDI';
              $.ajax({type:'GET',
            dataType:'json',
            url:myURL,
            success: function(json2) {
              console.log(myURL);
              var snippet = json2.snippet;
              var imgURL = json2.link;
              $("#background").css("background-image",imgURL);
            },
            cache:false
           });
            },
            cache: false
    });




  });
});
Darth Skywalker
@adityaparab
 var val = `${item} ${arr2[index]} ${arr3[index]}`;
is same as
 var val = item + " " + arr2[index] + " " + arr3[index];
Julian Mansueto
@julianmnst
@adityaparab is there a name for that ${} syntax?
Darth Skywalker
@adityaparab
@julianmnst : String templates or string literal syntax...
it's an ES6 feature
Khoa Le
@Zacele
I still don't get how the Argument objects works
could someone help me out
Julian Mansueto
@julianmnst
@adityaparab Hey man thank you a LOT. I'm a big fan of your name
CamperBot
@camperbot
julianmnst sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:warning: julianmnst already gave adityaparab points
Galib Hossain
@formulajp60

var Car = function(wheels, seats, engines) {
  //Change this constructor
  this.wheels = 4;
  this.seats = 5;
  this.engines = 1;
};

//Try it out here
var myCar = new Car(3, 1, 2);
Guys why my code is not working?
I am trying to create an object by passing argument.
Douglas Luce
@Doug-Luce
function myFunction(value1, value2){
    //Accessing the arguments function
  alert(arguments[0] + ' ' + arguments[1]);
}

myFunction('1', '2');
Darth Skywalker
@adityaparab
@julianmnst :+1:
Douglas Luce
@Doug-Luce
Here is an example of accessing the arguments object @Zacele
Darth Skywalker
@adityaparab
@Zacele :point_up: arguments object example
Khoa Le
@Zacele
function destroyer(arr) {
  // Remove all the value

  var result = [];

 for (i=0; i<arguments.length;i++){
   arg = arguments[i];
 }

  return arg;

}

destroyer([3, 5, 1, 2, 2], 2, 3, 5);
Khoa Le
@Zacele
that is my code
HeebieGeeBee
@HeebieGeeBee
this is the response i get
Khoa Le
@Zacele
it extract the right argument
Darth Skywalker
@adityaparab
@Zacele : You need to separate out all the arguments passed to a function from index 1 and onward.
Jean-Paul Sauve
@jp-sauve
aaw darn. that's why I was hitting 403
Darth Skywalker
@adityaparab
@Zacele you can run a for loop on arguments. Starting from i = 1 to i < arguments.length.
And then push arguments[i] in a separate array.
Khoa Le
@Zacele
@adityaparab which mean pass it to a new array ???
Jean-Paul Sauve
@jp-sauve
or I should just go back to older fork, make it look nice, and submit. What do you think?
Douglas Luce
@Doug-Luce
@formulajp60 Hey Galib, it seems to be working https://jsfiddle.net/p9x37gqp/
Jean-Paul Sauve
@jp-sauve
it would have been pretty cool to get automatic images working
cusbus
@cusbus
hi guys, sorry to barge in. i've been trying to figure this out for an hour now. it is just not clicking... i need to use this function to add ITEM to the end of the array, remove the first element of the array, and then return the element that was removed
Jean-Paul Sauve
@jp-sauve
read the suggested function docs carefully
cusbus
@cusbus
ugh. and i cant even copy code correctly...
h1tag
@h1tag
@cusbus review the array manipulation lessons
HeebieGeeBee
@HeebieGeeBee
@sevensixtwo762 no idea do whatever you think is best
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
flansolo
@flansolo
nvm no one knows
cusbus
@cusbus
@fortMaximus i have tried using .push and .shift
HeebieGeeBee
@HeebieGeeBee
@cusbus how are you using them cus thats what youre meant to use
h1tag
@h1tag
@cusbus show me your solution that uses push and shift