get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
return(Math.floor(Math.random()*10));
$
at the front
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
//function reverseString(str) {
str.split('');
str.reverse();
return str;
}
reverseString('hello').reverse();//
chriscrosscutler sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 640 | @dting | http://www.freecodecamp.com/dting
function reverseString(str) {
str.split('');
str.reverse();
str.join('');
return str;
}
reverseString('hello').reverse();
'''function reverseString(str) {
str.split('').reverse().join('');
return str;
}
reverseString('hello');'''
:bulb: to format code use backticks! ``` more info
```function reverseString(str) {
str.split('').reverse().join('');
return str;
}
reverseString('hello');```
function reverseString(str) {
var arry1 = str.split('');
var arry2 = arry1.reverse();
var arry3 = arry2.join('');
return arry3;
}
reverseString('my dog has fleas');
patrickmac110 sends brownie points to @tmosoff :sparkles: :thumbsup: :sparkles:
:star: 217 | @tmosoff | http://www.freecodecamp.com/tmosoff
function reverseString(str) {
return str.split('').reverse().join('');
}
function factorialize(num) {
var i;
var total = 1;
for(i = 1; i < num; i++)
{
newNUm = i * total;
}
newNum = num;
return num;
}
factorialize(5);
var Fact =1;
function factorialize(num) {
var Fact =1;
for(i = 1; i<= num; i++){
Fact *= i;
}
return Fact;
}
factorialize(5);
chriscrosscutler sends brownie points to @patrickmac110 :sparkles: :thumbsup: :sparkles:
:star: 193 | @patrickmac110 | http://www.freecodecamp.com/patrickmac110
*=
is nice isn't it
lux3 sends brownie points to @platypusrex :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for platypusrex
i
in your for loops.
var buildStreamObject = function(streamerName) {
var obj = {};
$.ajax({
url: 'https://api.twitch.tv/kraken/streams/' + streamerName,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/vnd.twitchtv.v3+json'
},
method: 'GET',
dataType: 'json',
success: function(stream) {
console.log(stream);
}
});
return obj;
};
&callback=?
to the end of the url...that will stop the cross-origin error...but then I'm getting an empty object.
xtimpi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 328 | @saintpeter | http://www.freecodecamp.com/saintpeter
function bouncer(arr) {
arr.filter(function(x) {
return Boolean(x);
});
return arr;
}
bouncer([7, 'ate', '', false, 9]);
xtimpi sends brownie points to @mattyamamoto and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: xtimpi already gave saintpeter points
:star: 307 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
timmcallister sends brownie points to @platypusrex :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for platypusrex
var newString = str.replace(/[.,!@#$%\^&\*()\-_=+]|\s/g, '').toLowerCase();
str.replace(/\W|_/gi, '').toLowerCase();
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 644 | @dting | http://www.freecodecamp.com/dting
function palindrome(str) {
// Good luck!
var newString = str.replace(/[.,!@#$%\^&\*()\-_=+]|\s/g, '').toLowerCase().split('').reverse().join('');
if(newString!=str.replace(/[.,!@#$%\^&\*()\-_=+]|\s/g, '').toLowerCase()){
return false;
}
else{
return true;
}
}
palindrome("race, CAR.");
Paste the following code into the <head> section of your site's HTML.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
nkuhan sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 645 | @dting | http://www.freecodecamp.com/dting
largest = array's first element
for each element in the array:
largest = larger of largest or element
min
& max
variables and not physically type in the numbers
nachal88 sends brownie points to @mukul215 :sparkles: :thumbsup: :sparkles:
:star: 173 | @mukul215 | http://www.freecodecamp.com/mukul215
function findLongestWord(str) {
// Separate words
var words = str.split(/\W/);
// Find longest word
for (var i = 0; i < words.length; i++) {
if (words[i].length > words[i++].length) {
str = words[i];
}
}
return str;
}
function findLongestWord(str) {
return Math.max(str);
}
var macks = [1,2,3,4,5,6,7,8,9,10,47382];
var myObj = findLongestWord.apply(myObj, macks);
//findLongestWord('The quick brown fox jumped over the lazy dog');
:bulb: to format code use backticks! ``` more info
'''function findLongestWord(str) {
str = str.split(' ');
var word = str[0];
for(var j = 0;j < str.length ; j++ ){
if(word.length <= str[j].length){
word = str[j];
}
}
str = word;
return str.length;
}
findLongestWord('The quick brown fox jumped over the lazy dog');
:bulb: to format code use backticks! ``` more info
function findLongestWord(str) {
str = str.split(' ');
var word = str[0];
for(var j = 0;j < str.length ; j++ ){
if(word.length <= str[j].length){
word = str[j];
}
}
str = word;
return str.length;
}
findLongestWord('The quick brown fox jumped over the lazy dog');
'''
function findLongestWord(str) {
str = str.split(' ');
var word = str[0];
for(var j = 0;j < str.length ; j++ ){
if(word.length <= str[j].length){
word = str[j];
}
}
str = word;
return str.length;
}
findLongestWord('The quick brown fox jumped over the lazy dog');
'''
:bulb: to format code use backticks! ``` more info
function findLongestWord(str) {
str = str.split(' ');
var word = str[0];
for(var j = 0;j < str.length ; j++ ){
if(word.length <= str[j].length){
word = str[j];
}
}
str = word;
return str.length;
}
findLongestWord('The quick brown fox jumped over the lazy dog');
function findLongestWord(str) {
// Separate words
var words = str.split(/\W/);
// declare a variable here to track your longest word or length.
// Find longest word
for (var i = 0; i < words.length; i++) {
// set that variable to the word or length if word[i] is longer
}
return str; // return longest length found
}
function truncate(str, num) {
if(str.length > num){
str = str.slice(0,num-3);
str = str + '...';
return str;
}
else
return false;
}
truncate('A-tisket a-tasket A green and yellow basket', 11);
assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length) === 'A-tisket a-tasket A green and yellow basket', 'should not truncate if string is = length');should not truncate if string is = length
function where(collection, source) {
var arr = [];
// What's in a name?
return arr;
}
where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).
more info:
bf details
|bf links
|hint
ram535 sends brownie points to @dting and @viznev :sparkles: :thumbsup: :sparkles:
:star: 238 | @viznev | http://www.freecodecamp.com/viznev
:star: 646 | @dting | http://www.freecodecamp.com/dting
function findLongestWord(str) {
var words = str.split(' ');
var lengths;
for(var j = 0; j<words.length; j++){
lengths.push(words[j].length);
}
return Math.max.apply(null,lengths);
}
findLongestWord('The quick brown fox jumped over the lazy dog');
var lengths = [];
patrickmac110 sends brownie points to @blueoceanview and @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for blueoceanview
:star: 169 | @kirah1314 | http://www.freecodecamp.com/kirah1314
hi guys! I have trouble in building a weather app.. below is my code: ```$(document).ready(function(){
var location = $('.submit').click(function(){
$('.location').val();
});
var url = "http://api.openweathermap.org/data/2.5/weather?q=" + location;
console.log(url);
$.getJSON(url).success(function(data) {
$('h3').text(Math.floor(data.main.temp - 273) + ' C' );
});
})
``` I want to let the user type in the city in a input field and then tell the weather. I am having trouble in jQuery as how to select the input value. It seems that after the user type the city and hit enter or submit button, the value still jump back to the initial value.
var location = $('.submit').click(function(){
$('.location').val();
});
var url = "http://api.openweathermap.org/data/2.5/weather?q=" + location;
console.log(url);
$.getJSON(url).success(function(data) {
$('h3').text(Math.floor(data.main.temp - 273) + ' C' );
});
})
curious-jane sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 649 | @dting | http://www.freecodecamp.com/dting
just completed and passed bonfire #7
function largestOfFour(arr) {
for (var i=0; i<arr.length; i++) {
for (var j=0; j<arr[i].length; j++) {
var array1 = Math.max.apply(Math, arr[j]);
var array2 = Math.max.apply(Math, arr[j+1]);
var array3 = Math.max.apply(Math, arr[j+2]);
var array4 = Math.max.apply(Math, arr[j+3]);
newArray = [];
newArray.push(array1, array2, array3, array4);
return newArray;
}
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Can someone help me clean up the middle part? is there a better way to compute the max on all four arrays in parallel?
function largestOfFour(arr) {
return arr.map(function(sub) {
return Math.max.apply(null, sub);
});
}
function largestOfFour(arr) {
var array1 = Math.max.apply(Math, arr[0]);
var array2 = Math.max.apply(Math, arr[1]);
var array3 = Math.max.apply(Math, arr[2]);
var array4 = Math.max.apply(Math, arr[3]);
newArray = [];
newArray.push(array1, array2, array3, array4);
return newArray;
}
function largestOfFour(arr) {
var newArray = [];
for (var i = 0; i < arr.length; i++) {
newArray.push(Math.max.apply(null, arr[i]);
}
return newArray;
}
p00gz sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 650 | @dting | http://www.freecodecamp.com/dting
Must input a string and check for a palindrome. Must remove punctuation from input and change to lower case. No clue here, so thought I would throw out some code and get some hints.
function palindrome(checkThis) {
checkThis = checkThis.stringReplace();
checkThis = checkThis.toLowerCase();
var array;
array = checkThis.split("");
array = array.reverse();
reversed = array.join("");
if (checkThis === reversed)
return true;
else return false;
}
palindrome("eye");
Nobody around in the HelpZiplines chat. Anybody able to help with this:
function newQuote() {
var generatedQuote = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById("randomQuote").innerHTML = generatedQuote;
}
newQuote();
function convert(str) {
return str.replace(/[&<>"']/g, function($0) {
return {"&":"&", "<":"<", ">":">", '"':""", "'":"'"}[$0];
});
};
var tweetText = convert(generatedQuote);
var tweetLink = "https://twitter.com/intent/tweet?t=" + tweetText + "&via=itzsaga&related=itzsaga,FreeCodeCamp";
document.getElementById("tweet").setAttribute("href",tweetLink).setAttribute("target","new");
I need to grab the generatedQuote
from the newQuote()
function so I can add it to my link when the tweet goes out. Thoughts?
document.getElementById("randomQuote").innerHTML
fyrfterjr sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 147 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
itzsaga sends brownie points to @dting and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 308 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 652 | @dting | http://www.freecodecamp.com/dting
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
and <img class="smaller-image class="thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
the completed tasks for the waypoint switch based on which class is assigned first, but can't get it to take both. I miss something in the instructions?
<img class="thick-green-border>"
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
which isn't as clean as I expected it would be.
@dting looks like this: ```<style>
...
.smaller-image {
width: 100px;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
</style>``` hopefully that's enough to answer your ?? Inserting the other code-snippets I see would be nice too :)
function findLongestWord(str) {
var words = str.split(' ');
var lengths;
for(var j = 0; j<words.length; j++){
lengths.push(words[j].length);
}
return Math.max.apply(null,lengths);
}
findLongestWord('The quick brown fox jumped over the lazy dog');
that's the original, sorry. here:
```function findLongestWord(str) {
var words = str.split(' ');
var lengths = [];
for(var j = 0; j<words.length; j++){
lengths.push(words[j].length);
}
var longest = Math.max.apply(null,lengths);
for(var l = 0; l<words.length; l++){
if(longest == lengths[l]){
return words[l];
}
}
}
findLongestWord('My name is patrick');
```
function findLongestWord(str) {
var words = str.split(' ');
var lengths = [];
for(var j = 0; j<words.length; j++){
lengths.push(words[j].length);
}
var longest = Math.max.apply(null,lengths);
for(var l = 0; l<words.length; l++){
if(longest == lengths[l]){
return words[l];
}
}
}
findLongestWord('My name is patrick');
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 653 | @dting | http://www.freecodecamp.com/dting
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
.thick-green-border {
border-style: solid;
border-width: 10px;
border-color: green;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
rharmaning sends brownie points to @jcrawford1122 and @dting :sparkles: :thumbsup: :sparkles:
:star: 148 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
:star: 653 | @dting | http://www.freecodecamp.com/dting
feners4 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 655 | @dting | http://www.freecodecamp.com/dting
why is it saying letterss.unshift is not a function?
```function titleCase(str) {
var letters = str.split('');
for(var m=0; m<letters.length; m++){
if(letters[m-1]==" "){
letters[m].toUpperCase();
}
}
var letterss = letters.shift();
letters[0].toUpperCase();
letterss = letterss.unshift(letters[0]);
return letterss;
}
titleCase("I'm a little tea pot");
```
function titleCase(str) {
var letters = str.split('');
for(var m=0; m<letters.length; m++){
if(letters[m-1]==" "){
letters[m].toUpperCase();
}
}
var letterss = letters.shift();
letters[0].toUpperCase();
letterss = letterss.unshift(letters[0]);
return letterss;
}
titleCase("I'm a little tea pot");
letterss
would be a string. which doesnt have an unshift method
pop()
removes last item in array
Hi, I'm having trouble with Waypoint: Iterate with JavaScript For Loops. Is this code correct? ```var myArray = [];
//Push the numbers zero through four to myArray using a "for loop" like above.
var ourArray = [];
for(var i = 0; i < 5; i++) {
ourArray.push(i);
}```
var ourArray = [];
myArray
function reverseString(str) {
return str;
}
reverseString('hello');
Reverse the provided string.
more info:
bf details
|bf links
|hint
thefacilitator sends brownie points to @dting and @xchelm :sparkles: :thumbsup: :sparkles:
:star: 166 | @xchelm | http://www.freecodecamp.com/xchelm
:star: 656 | @dting | http://www.freecodecamp.com/dting
<! Sample code
<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
h1.pink-text{
color: pink
}
</style>
<h1 class:"pink-text">Hello World!</h1>
@fritzkasala
Remember that in order to start a comment, you need to use <!-- and to end a comment, you need to use -->.
function titleCase(str) {
var letters = str.split('');
var input = str;
var firstLetter = letters[0].toUpperCase();
letters.shift();
letters.unshift(firstLetter);
for(var m=1; m<letters.length; m++){
if(letters[m-1]== " "){
letters[m].toUpperCase();
}
}
input = letters.join('');
return input;
}
titleCase("i'm a little tea pot");
.toUpperCase()
doesnt change the string. it returns the uppercase version of that string
function reverseString(str) {
return str;
}
reverseString('hello');
var string = ['hello' , 'Howdy', "Greetings from Earth"];
haremantra sends brownie points to @xchelm :sparkles: :thumbsup: :sparkles:
:star: 167 | @xchelm | http://www.freecodecamp.com/xchelm
letters[m] = letters[m].toUpperCase();
worked
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 658 | @dting | http://www.freecodecamp.com/dting
<!--
this stuff is commented out
-->
This stuff is not.
oyp sends brownie points to @xchelm :sparkles: :thumbsup: :sparkles:
:star: 168 | @xchelm | http://www.freecodecamp.com/xchelm
encodeURI
is not working?function newQuote() {
var generatedQuote = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById("randomQuote").innerHTML = generatedQuote;
var tweetText = encodeURI(generatedQuote);
var tweetLink = "https://twitter.com/intent/tweet?t=" + tweetText + "&via=itzsaga&related=itzsaga,FreeCodeCamp";
document.getElementById("tweet").setAttribute("href",tweetLink).setAttribute("target","new");
}
newQuote();
oyp sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 149 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
function add() {
return false;
}
add(2,3);
Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.
more info:
bf details
|bf links
|hint
function fn(greeting) {
return function(name) {
return greeting + name;
};
}
var myGreeting = fn("hello ");
myGreeting("bob");
myGreeting("chris");
etc
function add(numbers) {
var args = Array.prototype.slice.call(arguments);
var subtotal;
function addMore (additionalNumbers) {//function
return subtotal + arguments[1];
}
function sumAll (previousValue, currentValue) {//reduce
if (typeof previousValue !== "number" || typeof currentValue !== "number") {
return undefined;
} else {
return previousValue + currentValue;
}
}
function isANumber (value) {//filter
if (typeof value !=="number") {
return undefined;
} else {
return value;
}
}
if(typeof numbers !== "number") {
return undefined;
} else if (args.length > 1) {
return args.reduce(sumAll);
} else {//args.length < 1
subtotal = args[0];
//return add(subtotal, arguments[1]);
}
}
add(2, 3);
function addMore
else if (args.length > 1) {
return args.reduce(sumAll);
else {//args.length < 1
subtotal = args[0];
return addMore;
}
function sumAll(arr) {
return arr.reduce(function(acc, cur, _, a){
a.push();
}, Math.min(arr[0], arr[1]));
}
function createArr(strt, end) {
}
sumAll([1, 4]);
else {//args.length < 1
return function(v) {
if (typeof v !== 'number') return undefined;
return args[0] + v;
}
}
wontoan sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 662 | @dting | http://www.freecodecamp.com/dting
function chunk(arr, size) {
var outArray = [];
var inArray = [];
var newArray = [];
var counter = 0;
for (var i = 0; i < arr.length; i++){
if(counter > size){
newArray.push(inArray);
counter = 0;
}else{
inArray.push(arr[i]);
}
counter ++;
outArray.push(newArray);
}
return outArray;
}
chunk(['a', 'b', 'c', 'd', 'g', 'v'], 2);
1 < 5
is always true
drakemikels sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 663 | @dting | http://www.freecodecamp.com/dting
function chunk(arr, size) {
// Break it up.
return arr;
}
chunk(['a', 'b', 'c', 'd'], 2);
Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.
more info:
bf details
|bf links
|hint
function chunk(arr, size) {
var outArray = [];
var inArray = [];
var newArray = [];
var counter = 0;
for (var i = 0; i < arr.length; i++){
if(counter > size){
newArray.push(inArray);
counter = 0;
// what is inArray here each time? try console.log(inArray); here
}else{
inArray.push(arr[i]);
}
counter ++;
outArray.push(newArray);
}
return outArray;
}
function repeat(str, num) {
var string1 = '';
var string2 = '';
if(num > 0){
string1 = str.repeat(num);
return string1;
}
else {
return string2;
}
}
repeat('abc', 3);
var a = [];
var b = [];
var c = [];
var d = []
b.push(a);
a.push(1);
c.push(a);
a.push(2);
d.push(a);
a.push(3);
function repeat(str, num) {
if(num > 0){
return str.repeat(num);
}
else {
return str;
}
}
repeat('abc', 3);
jcrawford1122 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 664 | @dting | http://www.freecodecamp.com/dting
function repeat(str, num) {
return num > 0 ? str.repeat(num) : str;
}
function repeat(str, num) {
if (num > 0) {
return str.repeat(num);
}
return str;
}
function palindrome(str) {
// Good luck!
var str_arr = str.toLowerCase().split('');
var str_arr_rev = str.toLowerCase().split('').reverse();
var str_new="", str_rev = "";
for(var i = 0;i<str_arr.length;i++)
{
if(str_arr[i].charCodeAt()>96||str_arr[i].charCodeAt()<123)
{
console.log(i+" "+ str_arr[i].charCodeAt());
str_new +=str_arr[i];
}
if(str_arr_rev[i].charCodeAt()>96||str_arr_rev[i].charCodeAt()<123)
{
str_rev += str_arr_rev[i];
}
}
//console.log("value is "+str_new);
//console.log(str_rev);
return str_new == str_rev;
}
palindrome("race car");
there are not arrays
if i am not wrong i am adding them as string s @dting
str_arr.charCodeAt(0)>= 65 && str_arr.charCodeAt(0) <= 90
yashaswiyogeshwara sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 666 | @dting | http://www.freecodecamp.com/dting
yashaswiyogeshwara sends brownie points to @xchelm :sparkles: :thumbsup: :sparkles:
:star: 175 | @xchelm | http://www.freecodecamp.com/xchelm
For everyone finding themselves in front of a unix terminal a cautionary tale from a book I'm reading haha.
"in the winter of 1998, we’d been hit with a series of three smaller, random events—the first of which would threaten the future of Pixar.
To understand this first event, you need to know that we rely on Unix and Linux machines to store the thousands of computer files that comprise all the shots of any given film. And on those machines, there is a command—/bin/rm -r -f *—that removes everything on the file system as fast as it can. Hearing that, you can probably anticipate what’s coming: Somehow, by accident, someone used this command on the drives where the Toy Story 2 files were kept. Not just some of the files, either. All of the data that made up the pictures, from objects to backgrounds, from lighting to shading, was dumped out of the system."
I just about died reading this considering I've been using mv, cp and rm quite a bit it's like if I'm using a wildcard and I miss a few extra letters ... bye bye data
$(document).ready(function(){
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en", true);
xhr.send();
)}
cory2911 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 669 | @dting | http://www.freecodecamp.com/dting
@Mbos95
Let's try to set thirdLetterOfLastNameto equal the third letter of the lastName variable.
mbos95 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 673 | @dting | http://www.freecodecamp.com/dting
var a = []
a.length;
jesserafael sends brownie points to @biancamihai :sparkles: :thumbsup: :sparkles:
:star: 239 | @biancamihai | http://www.freecodecamp.com/biancamihai
zahin-10 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 678 | @dting | http://www.freecodecamp.com/dting
odera24 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 679 | @dting | http://www.freecodecamp.com/dting
<button class="navbar-toggle" data-toggle="collapse" data-target="#navHeaderCollapse">
you have that
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
ridlez sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 680 | @dting | http://www.freecodecamp.com/dting
bomholt sends brownie points to @mbos95 :sparkles: :thumbsup: :sparkles:
:star: 146 | @mbos95 | http://www.freecodecamp.com/mbos95
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
;
after each thing '
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
``` ⇦ Type 3 backticks, then press [shift + enter ⏎]
<paste your code here>,
then press [shift + enter ⏎]
``` ⇦ Type 3 backticks, then press [enter ⏎]
See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics
"&"
"&"
var string = str.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');
ahmeddin sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 94 | @camperbot | http://www.freecodecamp.com/camperbot
<script></script>
@import url("//fonts.googleapis.com/css?family=Indie+Flower");
@import url("//fonts.googleapis.com/css?family=Lato:400,400italic");
http:
also
animate.css
function largestOfFour(arr) {
// You can do this!
for (var i = 0; i < arr.length; i++){
for(var j = 0; j < arr[i].length; j++){
return arr[i][j];
}
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
[4, 5, 1, 3]
khanrafay sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 684 | @dting | http://www.freecodecamp.com/dting
luxan14 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 685 | @dting | http://www.freecodecamp.com/dting
stiino0 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 686 | @dting | http://www.freecodecamp.com/dting
:bulb: to format code use backticks! ``` more info
$(".logger").html("");
$(".logger").html("Not A Win")
$($('.slot')[0]).html(slotOne);
$($('.slot')[1]).html(slotTwo);
$($('.slot')[2]).html(slotThree);
'''
:bulb: to format code use backticks! ``` more info
dengjonathan sends brownie points to @remusandrei :sparkles: :thumbsup: :sparkles:
:star: 185 | @remusandrei | http://www.freecodecamp.com/remusandrei
for me worked with this: $(".target:nth-child(2)").addClass("animated bounce");
saad-bashar sends brownie points to @remusandrei and @duub :sparkles: :thumbsup: :sparkles:
:star: 178 | @duub | http://www.freecodecamp.com/duub
:star: 186 | @remusandrei | http://www.freecodecamp.com/remusandrei
soumyarauth sends brownie points to @deandersson :sparkles: :thumbsup: :sparkles:
:star: 232 | @deandersson | http://www.freecodecamp.com/deandersson
<!-- the bootstrap code -->
<div class="container">
<div class="page-header">
<h1>duub's Portfolio <small>things to share with you</small></h1>
</div>
<!-- the code worked for me -->
</div>
<div class="container page-header">
<h1>duub's Portfolio <small>things to share with you</small></h1>
</div>
padding-top: 50px
duub sends brownie points to @deandersson :sparkles: :thumbsup: :sparkles:
:star: 233 | @deandersson | http://www.freecodecamp.com/deandersson
:bulb: to format code use backticks! ``` more info
var test;
function mutation(arr) {
target = arr[0];
str = arr[1].split('');
str.forEach(function(item){
if(target.indexOf(item) == -1) {
console.log('false');
return false;
}
});
return true;
}
mutation(['hello', 'neo']);
<img class="class1 class2"
forEach
mutation
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image
{
width: 100px;
}
.thick-green-border
{
border-color: green;
border-width: 10px;
border-style: solid;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
alexkarpandrus sends brownie points to @deandersson :sparkles: :thumbsup: :sparkles:
:star: 234 | @deandersson | http://www.freecodecamp.com/deandersson
mustafamohsin sends brownie points to @deandersson :sparkles: :thumbsup: :sparkles:
:star: 235 | @deandersson | http://www.freecodecamp.com/deandersson
Hi guys, can anyone help me? I don't understand why this cose is not working. It should filter all non-false values of an array.
But it deletes also non-empty strings. Any suggests? Thank you!
` function bouncer(arr) {
// Don't show a false ID to this bouncer.
var filteredArr = arr.filter( function (value){
return !(value === '' || value === undefined || value === null || value === false || value === 0 || isNaN(value));
});
return filteredArr;
}
bouncer([7, 'ate', '', false, 9]);`
morley92 sends brownie points to @deandersson and @mustafamohsin :sparkles: :thumbsup: :sparkles:
:star: 21 | @mustafamohsin | http://www.freecodecamp.com/mustafamohsin
:star: 237 | @deandersson | http://www.freecodecamp.com/deandersson
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
.smaller-image {
width: 100px;
}
</style>
<a href="http://catphotoapp.com">
</a>
<h2 class="red-text">CatPhotoApp</h2>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Your a element should have the anchor text of "cat photos"
$(function weather(){
$.ajax ({
type:"GET",
url: "api.openweathermap.org/data/2.5/weather?",
success: function(data) {
console.log(data);
}
});
});
http://
or just //
Object {cod: "404", message: "Error: Not found city"}
https://
instead
Hey guys, I am having troubles with BasIc Javascript. Waypoint: Generate Random Whole Numbers within a Range
I have this now.
var min = 0;
var max = 9;
function myFunction() {
// Make myFunction return a random number between zero and nine instead of a decimal
// Only change code below this line.
Math.floor(Math.random() * (max - min +1));
}
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
dataType: 'JSON'
to the ajax request
jsonp
instead of just json
then u would have to use ajax
:bulb: to format code use backticks! ``` more info
<script>$(document).ready(function() {});</script>
<!-- You shouldn't need to modify code below this line -->
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>
cysys sends brownie points to @betsbillabong :sparkles: :thumbsup: :sparkles:
:star: 229 | @betsbillabong | http://www.freecodecamp.com/betsbillabong
function palindrome(str) {
function lowerC(l){
return l.toLowerCase();
}
return str.replace(/[A-Z]/g, lowerC);
}
palindrome("eye");
renelis sends brownie points to @xtimpi :sparkles: :thumbsup: :sparkles:
:star: 245 | @xtimpi | http://www.freecodecamp.com/xtimpi
renelis sends brownie points to @cysys :sparkles: :thumbsup: :sparkles:
:star: 117 | @cysys | http://www.freecodecamp.com/cysys
xtimpi sends brownie points to @eiselems :sparkles: :thumbsup: :sparkles:
:star: 226 | @eiselems | http://www.freecodecamp.com/eiselems