get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
$http
stuff?http://stackoverflow.com/questions/33190600/using-put-to-update-a-vote-count
@hansinla Thanks for the input. I just tried a whole bunch of options. Then I tried this:
myCar["engines"] = 4;
I don’t recall a Waypoint showing this technique prior, but it worked! Thanks!
easyspirit sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 542 | @hansinla | http://www.freecodecamp.com/hansinla
I'm a bit lost in trying to figure out the first zipline of a web portfolio. I think the challenge needs to list out the possible tools we'll want to use from bootstrap there. There seem to also be a lot of bootstrap features needed for it which are not taught in previous waypoints.
Here's mine: http://codepen.io/Philosophist/pen/xwZGar
Any tips of what to try and figure out or search for next would be appreciated.
This can be a tricky problem to understand. You need to find where in the array a number should be inserted by order, and return the index where it should go.
:pencil: read more about bonfire where do i belong on the FCC Wiki
function sumAll(arr) {
var min = Math.min.apply(null, arr);
var max = Math.max.apply(null, arr);
var newArr = [];
for (var i = arr[0]; i < arr[1]; i++) {
newArr.push(arr[i]);
}
return newArr;
}
sumAll([1, 4]);
pappilino sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 384 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
function sumAll(arr) {
var min = Math.min.apply(null, arr);
var max = Math.max.apply(null, arr);
var tempArr = [min, max];
var newArr = [];
for (var i = tempArr[0]; i <= tempArr[1]; i++) {
newArr.push(i);
}
return newArr.reduce(function(previousValue, currentValue) {
return previousValue + currentValue;
});
}
sumAll([1, 4]);
pappilino sends brownie points to @philosophist :sparkles: :thumbsup: :sparkles:
:star: 283 | @philosophist | http://www.freecodecamp.com/philosophist
for
loop instead of adding a reduce
<i>
classes for the icons I'm attempting to display, but I keep getting a broken icon box in the preview window
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 288 | @kirah1314 | http://www.freecodecamp.com/kirah1314
working on Where do I belong bonfire
function where(arr, num) {
var when = arr.concat(num);
var why = when.sort();
var who = why.indexOf(num);
// Find my place in this sorted array.
return who;
}
where([2,5,10], 15);
why is this returning 1 and not 3?
<button class="btn btn-primary" type="button" onclick="loadQuote()"><i class="fa fa-quote-left"></i> Give me another! <i class="fa fa-quote-right"></i></button>
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: samanthamed already gave kirah1314 points
* {
text-align: center;
font-family: Calibri !important;
background-color: #eeeeee !important;
}
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: samanthamed already gave kirah1314 points
<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;
}
div {background-color: gray;}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p>Click here for <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
``` ⇦ Type 3 backticks and 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
.red-text
class that's already in the code provides a good model.
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
``` ⇦ Type 3 backticks and 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
WayPoint
links ?
<div>
element in your html? If not, look at how the red-text
class is used in the <h2>
element for an example.
Here's the style element so far.. <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;
}
div .gray-background {background-color:gray;}
</style>
<div class="grey-background”>
……..</div>
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
``` ⇦ Type 3 backticks and 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
$('.main3').on('click', '.show', function() {
var id = $(this).attr('data-panel-id');
$('.project').hide(100);
$('#' + id).toggle(100);
})
$('.main3').on('click', '.show', function() {
var id = $(this).attr('data-panel-id');
$('.project').hide(100);
$('#' + id).toggle(100);
})
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
function reverseString(str) {
array = str;
array = array.reverse();
str = array;
return str;
}
reverseString("hello");
string.split()
then reverse it and convert it back a string
var name
margin: 0 auto
.gif
file in EZGIF.com.
.daiky00 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 615 | @abhisekp | http://www.freecodecamp.com/abhisekp
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 616 | @abhisekp | http://www.freecodecamp.com/abhisekp
<p>
opening tag needs to be before the a
element, the </p>
closing tag needs to be after the a
element
jauble sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 368 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
hey guys, are you not able to replace the ".text." in this line with ".innerHTML" or ".textContent"?
$(document).ready(function(){ $("h1").text("Hello"); });
@font-face {
font-family: "Font Name";
src: url("Fontfile-Regular.ttf") format("truetype");
}
I am having trouble on Waypoint: Use Hex Code for Specific Shades of Gray. Give your body element the background-color of a dark gray. My code says:
<style>
body {
background-color: dark gray;
color: #111111;
}
</style>
This does not work. Any suggestions?
<style>
body {
background-color: #111111;
}
</style>
You have to check if the string you get as an input is a palindrome and return true
if it is, and false
otherwise.
:pencil: read more about bonfire check for palindromes on the FCC Wiki
function palindrome(str) {
var newstr = str.toLowerCase('');
var array = newstr.split('').reverse().join('');
if newstr == array;
return true;
else
return false;
}
palindrome("eye");
katie-s sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 205 | @bruglesco | http://www.freecodecamp.com/bruglesco
jones-codes sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 281 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
qualitymanifest sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1421 | @dting | http://www.freecodecamp.com/dting
Warriors.find({}, {sort: {rank: 1}});
Warriors.find({}, {sort: {rank: -1}});
Warriors = new Mongo.Collection("warriors");
if (Meteor.isServer) {
Meteor.publish('theWarriors', function(){
return Warriors.find();
});
Meteor.methods({
'draftWarrior': function(selectedWarrior){
var currentUserId = Meteor.userId();
Warriors.update(selectedWarrior, {$addtoSet: {draftedBy: currentUserId}});
},
'insertWarriorData': function(warriorNameVar, rankVar, weaponVar, armorVar){
var currentUserId = Meteor.userId();
Warriors.insert({
name: warriorNameVar,
rank: rankVar,
weapon: weaponVar,
armor: armorVar,
createdBy: currentUserId
});
},
'removeWarriorData': function(selectedWarrior){
var currentUserId = Meteor.userId();
Warriors.remove(selectedWarrior);
//Warriors.remove({_id: selectedWarrior, createdBy: currentUserId});
}
});
}
if (Meteor.isClient) {
Meteor.subscribe('theWarriors');
Template.warrior.helpers({
warriors: function () {
//Show highest rank at the top
var currentUserId = Meteor.userId();
return Warriors.find({}, {sort: {rank: -1}});
}
});
Template.newWarrior.events({
'submit form': function(event){
event.preventDefault();
var warriorNameVar = event.target.warriorName.value;
var rankVar = event.target.rank.value;
var weaponVar = event.target.weapon.value;
var armorVar = event.target.armor.value;
Meteor.call('insertWarriorData', warriorNameVar, rankVar, weaponVar, armorVar);
event.target.warriorName.value = "";
event.target.rank.value = "";
event.target.weapon.value = "";
event.target.armor.value = "";
}
});
<input class="form-control" type="number" name="rank" min="1" max="64" placeholder="Enter Warrior's Rank">
'insertWarriorData': function(warriorNameVar, rankVar, weaponVar, armorVar){
check(rankVar, Number); // Insert this line
var currentUserId = Meteor.userId();
Warriors.insert({
name: warriorNameVar,
rank: rankVar,
weapon: weaponVar,
armor: armorVar,
createdBy: currentUserId
});
},
var rankVar = +event.target.rank.value;
event.target.rank.value = "";
jones-codes sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1423 | @dting | http://www.freecodecamp.com/dting
rankVar = Number(rankVar);
jones-codes sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: jones-codes already gave dting points
function palindrome(str) {
var newstr = str.replace(/[^\w\d]/gi,'').toLowerCase();
//return newstr;
var strReverse = newstr.split('').reverse().join('');
//return strReverse;
if (newstr==strReverse){ return true; } else { return false;
}
}
palindrome("0_0 (: /-\ :smile: 0-0 ")
function palindrome(str) {
var newstr = str.replace(/[^\w\d]|_/gi,'').toLowerCase();
//return newstr;
var strReverse = newstr.split('').reverse().join('');
//return strReverse;
if (newstr==strReverse){
return true;
}
else
{
return false;
}
}
palindrome("0_0 (: /-\ :) 0-0 ");
/\W|_/
or /[\W_]/
also work
Hi designviacode! You've successfully authenticated, but GitHub does not
# provide shell access.
PTY allocation request failed on channel 0
Hi designviacode! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
git@github.com:designviacode/hello-world.git
:bulb: to format code use backticks! ``` more info
:bulb: to format code use backticks! ``` more info
git clone git@github.com:designviacode/hello-world.git
designviacode sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:star: 295 | @bodonkey | http://www.freecodecamp.com/bodonkey
git config --global user.name "designviacode"
git config --global user.name
it shows : designviacode
slibre2 sends brownie points to @quincylarson :sparkles: :thumbsup: :sparkles:
:star: 140 | @quincylarson | http://www.freecodecamp.com/quincylarson
designviacode sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:warning: designviacode already gave bodonkey points
<input type="text" placeholder="cat photo URL">
?
```<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>```
slibre2 sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:star: 296 | @bodonkey | http://www.freecodecamp.com/bodonkey
slibre2 sends brownie points to @abhisekp and @all :sparkles: :thumbsup: :sparkles:
:star: 619 | @abhisekp | http://www.freecodecamp.com/abhisekp
:warning: could not find receiver for all
var winModal = function () {
if (xWins == true) {
$(".winAlert").fadeIn(1000);
}
else if (oWins == true) {
$(".loseAlert").fadeIn(1000);
}
}
};
#cat-photo-form {
background-color: green;
}
<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;
}
.gray-background {
background-color: gray
}
#cat-photo-element {
background-color: green; }
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p>Click here for <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="/submit-cat-photo" id="cat-photo-form" "cat-photo-element">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
#cat-photo-form {
background-color: green;
}
eclecticsquare sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 298 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
eclecticsquare sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:warning: eclecticsquare already gave thehighpriestess points
class = "first second"
var Car = function() {
this.wheels = 4;
};
// Only change code below this line.
var myCar = new Car();
engines = 1;
//Add the property "engines" to myCar, and make it a number.
// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
What I'm doing wrong? This error shows up :
"The Property engines of myCar should be a number"
this.engines
, this
is bound to global
, use myCar.engines = 1
instead.
saadi123 sends brownie points to @ronaldrdguez :sparkles: :thumbsup: :sparkles:
:star: 356 | @ronaldrdguez | http://www.freecodecamp.com/ronaldrdguez
on my task "Give elements with the red-text class a font-size of 16px." what am I doing wrong?
<style>
.red-text {
color: red;
}
h1 { font-size: 16px; }
</style>
<h2>CatPhotoApp</h2>
<p class="red-text" class="h1">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" class="h1">kitty ipsum 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>
this.property = value
outside the function definition. this
Has nothing to do with Car anymore, instead it refers to the global
object. What you’re doing in that case is basically creating a global variable, same as engines = 1
. Take a look at Udacitys Object Oriented Javascript course, they have a nice explanation on the parameter this
.
h1 { font-size: 16px; }
adds the font size to every h1 on the page. You need to add the property to the .red-text
selector so it will only be applied to elements with the red-text
class.
.loseAlert{
display: none;
}
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
thehighpriestess sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 543 | @hansinla | http://www.freecodecamp.com/hansinla
function mutation(arr) {
var Narr = arr[0].split("");
var Marr = arr[1].split("");
for(var i = 0; i < Marr.length; i++){
if(Narr.indexOf(Narr[i]) !== -1){
return true;
}else{
return false;
}
}
}
mutation(["hello", "hey"]);
rejreign sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:star: 283 | @jlslew | http://www.freecodecamp.com/jlslew
acotlow sends brownie points to @aneequrrehman :sparkles: :thumbsup: :sparkles:
:star: 180 | @aneequrrehman | http://www.freecodecamp.com/aneequrrehman
I have write this on my code but does not work
<p>Click here for <#>="http://www.freecatphotoapp.com">cat photos</#>.</p>
In your case, it's just
<p>Click here for <a href="#">cat photos</a>.</p>
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
// Only change code below this line.
// Only change code above this line.
}
// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
i feel like this exercise assumes i've done this kind of thing before. but i have not. and have no idea how to write what it wants. can anyone offer the solution and an explanation of why it's written that way? i've tried several wrong combinations but this is more technical than logical at the time to me.
if(obj.hasOwnProperty(t[i])) {
if(obj[t[i]] == source[t[i]]) {
return true;
}
}
return false;
if(!obj.hasOwnProperty(t[i]) || obj[t[i] !== source[t[i]]) {
return flase;
}
return true;
@nicktrull You need to follow the example in the sidebar of how to write an if-statement but change the comparison and return value to match what the question is asking you to do. Here’s what that should look like:
if (flip === 0) {
return "heads";
} else {
return "tails";
}
This code checks if the variable flip
has the value zero and returns a string ”heads”
if it does. Otherwise it returns a string ”tails”
A && B === (!A || !B)
nicktrull sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 244 | @ltegman | http://www.freecodecamp.com/ltegman
// INITIALIZES GAME - keep after var newGame
$(document).ready(function () {
newGame();
});
nicktrull sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:warning: nicktrull already gave ltegman points
thehighpriestess sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 44 | @mildused | http://www.freecodecamp.com/mildused
cac03 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1060 | @saintpeter | http://www.freecodecamp.com/saintpeter
cac03 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: cac03 already gave saintpeter points
For Waypoint: Bring your JavaScript Slot Machine to Life
I enter this as code:
$($".slot")[0]).html(slotOne);
$($".slot")[1]).html(slotTwo);
$($".slot")[2]).html(slotThree);
And it tells me:
missing ) after argument list
What am I doing wrong?
(
:$($(".slot
First, create a h1 element with the text Hello World.
Then, let's give all elements on your page the color of green by adding color: green; to your body element's style declaration.
Finally, give your body element the font-family of Monospace by adding font-family: Monospace; to your body element's style declaration.
<h1>
element)
abdonaguib sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1068 | @saintpeter | http://www.freecodecamp.com/saintpeter
navbar-fixed
?
navbar-fixed-top
.div1background {
margin-top: 50px;
}
dseabra1984 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 249 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
type bonfire name
to get some info on that bonfire. And check HelpBonfires chatroom
function where(collection, source) {
var arr;
var src_keys = Object.keys(source);
var src = source;
var result = '';
var bool = false;
for(i=0;i<collection.length;i++) {
arr = collection[i]
for(k=0;k<src_keys.length;k++) {
if(arr[src_keys[k]] === src[src_keys[k]]) {
bool = true;
} else {
bool = false;
}
}
if(bool === true) {
result += arr;
}
}
//arr = collection[0]["last"];
//arr = collection[0].hasOwnProperty("first");
//arr = collection[0][src_keys[0]];
// What's in a name?
return result;
}
//where([{ "a": 1 }, { "a": 1 }, { "a": 1, "b": 2 }], { "a": 1 })
where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
:bulb: to format code use backticks! ``` more info
@gunrunners-paradise
if(arr[src_keys[k]] === src[src_keys[k]]) {
bool = true;
} else {
bool = false; // What if your first item doesn't match, but your second does?
}
result
needs to be an array, and push arr
onto it
var array = [4,5,6,7,8];
var singleVal = total;
// Only change code below this line.
var total = array.reduce(function(prev, cur)) {
return prev+cur;
});
// Only change code above this line.
(function() {return singleVal;})();
var singleVal = 0
Reduce can be useful for condensing an array of numbers into one value.
var singleVal = array.reduce(function(previousVal, currentVal){
return previousVal+currentVal;
});
Use the reduce function to sum all the values in array and assign it to singleVal.
Here are some helpful links:
Array.reduce()
var singleVal = ....
)
in there
reduce
method callback. The variable name prev
doesn't tell a story. But you can replace it with total
.
daiky00 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 620 | @abhisekp | http://www.freecodecamp.com/abhisekp
daiky00 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 382 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
daiky00 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 250 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
var someFunct = function() { return 1; }; // Last semicolon needed to complete the assignement
abhi493 sends brownie points to @abhisekp and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 621 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 1071 | @saintpeter | http://www.freecodecamp.com/saintpeter
yourName.length > myName.length
Vectorjay X Vectorjay
var city = prompt(" Which is your favourite city!").toUpperCase();
switch(city){
case'Florida':
if(city && Florida){
console.log(" Awesome city to leave in");
}else{
console.log(" Florida is not awesome");
}
break;
case'Broklyn':
if(city || Broklyn){
console.log("Gangstar area in the USA");
}else{
console.log("Not a ganstar city!");
}
break;
case'Texas':
console.log("Partly dorminated by rich africans");
break;
default:
console.log(" You entered a wrong city");
}
'FLORIDA'
, 'BROKLYN'
, etc
https://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661
Find other libraries at http://jster.net
See Also: :loop: Quick JS | :watch: Challenges | :wrench: Exercises | :clipboard: Editors | :newspaper: Blogs | :books: Books
abhi493 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: abhi493 already gave abhisekp points
:star: 372 | @camperbot | http://www.freecodecamp.com/camperbot
abhi493 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
that icon can be written outside of heading
<img src="icon.png">
<h1>I'm A Goat</h1>
and use CSS to do some magic and everything look perfect.
@ThekhoN
<div class="style-me">
<img src="icon.png">
<h1>I'm A Goat</h1>
</div>
thekhon sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 622 | @abhisekp | http://www.freecodecamp.com/abhisekp
dseabra1984 sends brownie points to @veeshostak :sparkles: :thumbsup: :sparkles:
:star: 197 | @veeshostak | http://www.freecodecamp.com/veeshostak
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
[Link Title](http://blablabla)
Find other libraries at http://jster.net
See Also: :loop: Quick JS | :watch: Challenges | :wrench: Exercises | :clipboard: Editors | :newspaper: Blogs | :books: Books
find js
:zero: js fundamental
:one: js resources
:two: zipline use the twitchtv json api
:three: js arguments
:four: js closures
:five: js falsy
:six: js filter
:seven: js for in
:eight: js for of
:nine: js for
:one::zero: js immutable
:one::one: js indexof
:one::two: js loops
:one::three: js map
:one::four: js regex
:one::five: js scope
:one::six: js slice
:one::seven: js ternary
:one::eight: js truthy
:one::nine: js undefined
limited to first 20 entries.
typefind js
again for more enteries.
Hi, just a simple question, I have done this:
<style>
body {
background-color: black;
}
.h1 {
color: green;
font-family: Monospace;
}
</style>
<h1 class="h1"> Hello World </h1>
But i think i have made some errors because It wont let me go trhu, I get this 2 errors:
any help with this little problem.
<h1>
not to <body>
h1
is not a class, so you need to lose the .
<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 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>
francescoeri sends brownie points to @hansinla and @tanasic :sparkles: :thumbsup: :sparkles:
:star: 544 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 83 | @tanasic | http://www.freecodecamp.com/tanasic
space
after :
in your stylesheet.
border-width: 10px;
is correct
My dear Roman Numeral Converter is dysfunctional:
function convert(num) {
var rechim = num.toString().split("");
var l = rechim.length - 1;
console.log(rechim);
if (rechim[-1] === 1) {rechim.splice(-1,1, "I")}
else if (rechim[-1] === 2) {rechim.splice(l-1,1, "II")}
else if (rechim[-1] === 3) {rechim.splice(l-1,1, "III")}
else if (rechim[-1] === 4) {rechim.splice(l-1,1, "IV")}
else if (rechim[-1] === 5) {rechim.splice(-l1,1, "V")}
else if (rechim[-1] === 6) {rechim.splice(l-1,1, "VI")}
else if (rechim[-1] === 7) {rechim.splice(l-1,1, "VII")}
else if (rechim[-1] === 8) {rechim.splice(l-1,1, "VIII")}
else if (rechim[-1] === 9) {rechim.splice(l-1,1, "IX")}
else if (rechim[-1] === 0) {rechim.splice(l-1,1,"")}
if (rechim[-2] ===1) {rechim.splice(l-2,1,"X")}
else if (rechim[-2] ===2) {rechim.splice(l-2,1,"XX")}
else if (rechim[-2] ===3) {rechim.splice(l-2,1,"XXX")}
else if (rechim[-2] ===4) {rechim.splice(l-2,1,"Xl")}
else if (rechim[-2] ===5) {rechim.splice(l-2,1,"L")}
else if (rechim[-2] ===6) {rechim.splice(l-2,1,"LX")}
else if (rechim[-2] ===7) {rechim.splice(l-2,1,"LXX")}
else if (rechim[-2] ===8) {rechim.splice(l-2,1,"LXXX")}
else if (rechim[-2] ===9) {rechim.splice(l-2,1,"XC")}
else if (rechim[-2] ===0) {rechim.splice(l-2,1,"")}
if (rechim[-3] ===1) {rechim.splice(l-3,1,"C")}
else if (rechim[-3] ===2) {rechim.splice(l-3,1,"CC")}
else if (rechim[-3] ===3) {rechim.splice(l-3,1,"CCC")}
else if (rechim[-3] ===4) {rechim.splice(l-3,1,"CD")}
else if (rechim[-3] ===5) {rechim.splice(l-3,1,"D")}
else if (rechim[-3] ===6) {rechim.splice(l-31,"DC")}
else if (rechim[-3] ===7) {rechim.splice(l-3,1,"DCC")}
else if (rechim[-3] ===8) {rechim.splice(l-3,1,"DCCC")}
else if (rechim[-3] ===9) {rechim.splice(l-3,1,"CM")}
else if (rechim[-3] ===0) {rechim.splice(l-3,1,"")}
console.log(rechim);
return rechim.join("");
}
convert(36);
surprising result: "36"
equlnox sends brownie points to @hansinla and @tanasic and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 545 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 85 | @tanasic | http://www.freecodecamp.com/tanasic
:star: 1074 | @saintpeter | http://www.freecodecamp.com/saintpeter
parseInt
navyvel sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1076 | @saintpeter | http://www.freecodecamp.com/saintpeter
navyvel sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 374 | @camperbot | http://www.freecodecamp.com/camperbot
function sumFibs(num) {
return num;
}
sumFibs(4);
Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.
more info:
bf details
|bf links
|hint
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
I have a jQuery question. I am currently doing a static todo app, and for dynamically generated checkboxes, the .change()
event does not work, as opposed to a pre-existing checkbox (one that was part of the original DOM) where it would work. Why is that?
What I am trying to do is, if the user changes/clicks on the checkbox, a class would be toggled on its sibling <label>
. It doesn’t work for injected checkboxes. How can I go about fixing this?
hi sorry I'm a bit stuck here "Use Font Awesome to add a thumbs-up icon to your like button by giving it a i element with the classes fa and fa-thumbs-up."
this is what i did:
<button class="btn btn-block btn-primary fa i fa-thumbs-up">Like</button>
.on('change', ....
for dinamycfunction yourTurn() {
var currentPosition = 0;
var pressTracker = 0;
$('.gameButton').mousedown(function() {
yourNum = parseInt(this.id)
lightPressed(yourNum);
yourSeq[currentPosition] = yourNum;
})
$('.gameButton').mouseup(function() {
checkLight(currentPosition);
currentPosition++;
console.log(currentPosition, yourSeq.length);
})
if (currentPosition == 1) {
console.log("done");
return;
}
}
abeermorssy sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 379 | @moigithub | http://www.freecodecamp.com/moigithub
hi, what does it means this :
"Give your form's text input field a class of form-control. "
and how i can fix it on the right way?
Here's my code:
<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL" required>
<button class="btn btn-primary" type="submit"><i class="fa fa-paper-plane"></i>Submit</button>
</form>
@francescoeri just give your text input field i.e. <input type="text" placeholder="cat photo URL" required> a class of "form-control." So it will be
<input class="form-control" type="text" placeholder="cat photo URL" required>
"form-control" is class from Bootstrap for input text fields.
Okay. I'm just starting out, and I can't get h2 to have the font-family Lobster. Here's my code:
<style>
.red-text {
color: red;
}
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
h2 {
font-family: Lobster;
}
Can someone tell me what I'm doing wrong?
vixtar sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1080 | @saintpeter | http://www.freecodecamp.com/saintpeter