img-responsive
class to each
:cookie: 206 | @garysiu |http://www.freecodecamp.com/garysiu
mejiaadonay sends brownie points to @garysiu :sparkles: :thumbsup: :sparkles:
height: 400px !important;
msp327 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1343 | @dhcodes |http://www.freecodecamp.com/dhcodes
function addTogether(num1, num2) {
for (i = 0; i < arguments.length; i++) {
if (typeof arguments[i] !== 'number') {
return undefined;
}
}
if (arguments.length > 1) {
return num1 + num2;
} else {
var prev = arguments[0];
return function(num) {
return prev + num;
};
}
}
addTogether(2,[3]);
I am working on the "Arguments Optional" algorithm and I can't get the last test to pass (where parameters are (2, [3]). I've run it in jsFiddle and it seems to work as expected. Anyone have any ideas? Is this a bug?
a{
color: #ffffff !important;
}
to make the text on buttons more visible
return function(num) {
return prev + num;
};
If either argument isn't a valid number, return undefined.
mlawson3691 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1364 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
[Object object]
is being entered into the tweet box. Here is my CodePen: http://codepen.io/twhite96/pen/XKqrJX
text()
right @qualitymanifest
text()
instead of html in the places that make the most sense. But it still results in an array
twhite96 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1365 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
$.getJSON(' http://ip-api.com/json', function(json){here you grab the returned data and do whatever with it});
then call an weather api using the coordinates from the previous api call
why is image not able to open link??
<div class="social" id="facebook"><a herf="https://www.facebook.com/erickeagle54" target="_blank"><img src="http://www.iconsdb.com/icons/preview/icon-sets/ice/facebook-3-xxl.png"></a></div>
@angusjonior
208 Counting Cards How to add the count and“Hold”“Bet”?
var count = 0;
function cc(card) {
// Only change code below this line
if(card<=6&&card>=2){
count = count + 1;
}else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
count = count - 1;
}
return count;
// Only change code above this line
}
cc(2); cc(3); cc(7); cc('K'); cc('A');
:cookie: 674 | @sorinr |http://www.freecodecamp.com/sorinr
milos2709 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
lomm28 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 675 | @sorinr |http://www.freecodecamp.com/sorinr
:cookie: 676 | @sorinr |http://www.freecodecamp.com/sorinr
markushald sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
shailza sends brownie points to @gauravtolani :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @gauravtolani |http://www.freecodecamp.com/gauravtolani
background: linear-gradient(to right, #ffffff 0%,#ffffff 49%,#207cca 50%,#207cca 50%,#207cca 100%,#207cca 100%);
adamhj123 sends brownie points to @ashish1729 :sparkles: :thumbsup: :sparkles:
:cookie: 374 | @ashish1729 |http://www.freecodecamp.com/ashish1729
adamhj123 sends brownie points to @laurenconners :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @laurenconners |http://www.freecodecamp.com/laurenconners
$(function () {
var color = ['red', 'blue', 'yellow', 'green', 'black', 'pink', 'purple', 'grey'];
var randomColor = color[Math.floor(Math.random ()*color.length)];
$('.Mix_button').click(function{ $('body').css('background-color', randomColor);
});
});
I got problem with that... My console sad that is a problem with secound function {can somebody tell me why random color is not working properly? :(
var twitchApi = 'https://api.twitch.tv/kraken/';
// and then invoked
$.getJSON(twitchApi + "channels"
//or
$.getJSON(twitchApi + "streams"
if(data.status === 422){alert('Account is closed');}
.fail(error => console.log(error));
$.getJSON(function() {... your code}).fail(function (error) {
console.log(error)
});
help how to add code in chat
else if ($("#result").text().slice(-1)==="/"||"*"||"+"||"-"&&clickedButton==="/"||"*"||"+"||"-"){
var ==="something" || var === "somethingElse"
<div class='col-md-3 col-xs-' id='division'>
<p>/</p>
on ur if code above.. as i said above.. u doing something likeif(myVar === 1||2||3||4 ) { ... }
<-- wrong
u should do something likeif(myVar === 1||myVar === 2|| myVar === 3||myVar === 4){ .... }
@mikail1998
designbuildshipsoftware sends brownie points to @trip16661 and @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 464 | @trip16661 |http://www.freecodecamp.com/trip16661
:cookie: 677 | @sorinr |http://www.freecodecamp.com/sorinr
another way to do (what above code does) is using arrays methods... ie...
var myValues = [1,2,3,4];
if( myValues.includes( myVar ) ) { ..... }
@mikail1998
mikail1998 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1960 | @moigithub |http://www.freecodecamp.com/moigithub
console.log($("#result").text());
var test = false;
if (test) { console.log("meeee");}
else { console.log("booo"); }
var b=1;
var a = 1;
if (a || b < 0) {
console.log("a or b are less than 0");
} else {
console.log("zzzzzz") ;
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(location, error);
} else {
alert("Geolocation not supported");
}
function error() {
alert("Sorry you are in outer space");
}
ayyazzafar sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1346 | @dhcodes |http://www.freecodecamp.com/dhcodes
hi guys my code isn't working at all I cannot get the temperature back from the call any idea why ? plssss help me.
var lat, lon, weather;
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(location, error);
} else {
alert("Geolocation not supported");
}
function error() {
alert("Sorry you are in outer space");
}
function location(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
weather = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=";
$.ajax({
url: weather,
dataType: 'jsonp',
success: function(data) {
var temp = data.main.temp;
$("#temp").html(temp);
}
});
}
I didnt want to share my api
williamface sends brownie points to @ayyazzafar :sparkles: :thumbsup: :sparkles:
:cookie: 8 | @ayyazzafar |http://www.freecodecamp.com/ayyazzafar
sorry this one is more organized
var lat, lon, weather;
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(location, error);
} else {
alert("Geolocation not supported");
}
function error() {
alert("Sorry you are in outer space");
}
function location(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
weather = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&units=metric&APPID=";
$.ajax({
url: weather,
dataType: 'jsonp',
success: function(data) {
var temp = data.main.temp;
$("#temp").html(temp);
}
});
}
I didnt want to share my api
&callback=?
to the end of your url
williamface sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1347 | @dhcodes |http://www.freecodecamp.com/dhcodes
searchObj = JSON.parse(request.responseText);
is still not working
/**/
- I am not sure but the jsonp I have seen starts with /**/
but not sure.
JSON.parse(request.response)
williamface sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2776 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
williamface sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: williamface already gave sjames1958gm points
rony126 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2777 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Object.keys(obj).forEach(function(k) { obj[k] = "foobar";});