get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
Evening all. Need some help with the Profile Lookup challenge (http://www.freecodecamp.com/challenges/profile-lookup). I am having difficulty working out how to access the firstName property.
I cannot work out why my for loop counter variable is not incrementing each time it runs, for example.
for (var i = 0; i < contacts.length; i++) {
return contacts[i].firstName;
}
return
statement you exit your loop and function :-(prop
property not always firstName
.
carlmungazi sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1758 | @takumar | http://www.freecodecamp.com/takumar
firstName
is a property so you don't have to return both :-)
else if (nextIndex-1 !==0 && $(window).width() > 500) {
$('li').css("background-color", rgba(0, 0, 0, 0.1));
};
What's wrong with this LOC? It breaks my website's code when uncommented ;-;
for (var i = 0; i < contacts.length; i++) {
if (firstName === contacts[i].firstName) {
if (prop === contacts[i][prop]) {
return prop;
} else {
return "No such property";
}
return firstName;
} else {
return "No such contact";
}
}
<div class="container-fluid">
<all HTML elements here>
</div>
function lookUp(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (firstName === contacts[i].firstName) {
if (firstName === contacts[i][prop]) {
return prop;
} else {
return "No such property";
}
return firstName;
} else {
return "No such contact";
}
}
// Only change code above this line
}
// Change these values to test your function
lookUp("Kristian", "likes");
function rot13(str) { // LBH QVQ VG!
var a = [];
var b = str[0];
a =str.charCodeAt(str[1]);
return a;
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
Why is c getting sa null value?
function lookUp(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (firstName === contacts[i].firstName) {
if (contacts[i].hasOwnProperty(prop) {
return contacts[i][prop];
}
else { return "No such property"; }
} /*if #1*/
} /*for*/
else {
return "No such contact"; }
// Only change code above this line
}
// Change these values to test your function
lookUp("Kristian", "likes");
<!--looks good , also this is a comment in html-->
function lookUp(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (firstName === contacts[i].firstName) {
if (contacts[i].hasOwnProperty(prop) {
return contacts[i][prop];
}
else { return "No such property"; }
} /*if #1*/
} /*for*/
else {
return "No such contact"; }
// Only change code above this line
}
// Change these values to test your function
lookUp("Kristian", "likes");
how about this?
function lookUp(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (firstName === contacts[i].firstName) {
if (contacts[i].hasOwnProperty(prop))
{
return contacts[i][prop];
}
else
{
return "No such property";
}
}
}
return "No such contact";
// Only change code above this line
}
@CarlMungazi I've checked it, it's working (:
carlmungazi sends brownie points to @noczesc :sparkles: :thumbsup: :sparkles:
:star: 316 | @noczesc | http://www.freecodecamp.com/noczesc
<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>
<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" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>
<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>
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="outdoor"> Outdoor</label>
carlmungazi sends brownie points to @noczesc and @tommygebru :sparkles: :thumbsup: :sparkles:
:warning: carlmungazi already gave noczesc points
:star: 345 | @tommygebru | http://www.freecodecamp.com/tommygebru
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for(var i = 0; i < multiplyAll.length; i++){
arr += multiplyAll;
}
// Only change code above this line
return product;
}
// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
I'm working on Nesting For Loops and I'm stuck. Can I get some help please?
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for(var i = 0; i < arr.length; i++){
for(var x = 0; x < arr.length, x++){
console:log(arr[i][x]);
}
};
}
It's still not working.
<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;
}
</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>
<img class="smaller-image"src="https://bit.ly/fcc-relaxing-cat">
to-be-an-ocean sends brownie points to @cademis :sparkles: :thumbsup: :sparkles:
:star: 23 | @cademis | http://www.freecodecamp.com/cademis
<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;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">
<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>
codescout811 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 346 | @tommygebru | http://www.freecodecamp.com/tommygebru
result=lookup[val];
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.smaller-image {
width: 100px;
}
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
</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>
objectName[keyName]
haroonghawsi sends brownie points to @robert197 and @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 347 | @tommygebru | http://www.freecodecamp.com/tommygebru
:star: 66 | @robert197 | http://www.freecodecamp.com/robert197
haroonghawsi sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:warning: haroonghawsi already gave tommygebru points
<!--
<h1>Hello World</h1>
-->
<h2>CatPhotoApp</h2>
<!--
<p>Hello Paragraph</p>
-->
pranavsakthi sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 424 | @cannelflow | http://www.freecodecamp.com/cannelflow
pranavsakthi sends brownie points to @centraleft :sparkles: :thumbsup: :sparkles:
:star: 281 | @centraleft | http://www.freecodecamp.com/centraleft
"The hasOwnProperty() method returns a boolean indicating whether the object has the specified property."
your
if (checkProp === myObj.hasOwnProperty())
essentially says
if (checkProp === true)
farionlord sends brownie points to @robert197 :sparkles: :thumbsup: :sparkles:
:star: 67 | @robert197 | http://www.freecodecamp.com/robert197
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for(var i = 0; i < arr.length; i++){
for(var x = 0; x < arr.length, x++){
console.log(arr[i][x]);
}
}
}
I'm still struggling with this.
console:log(arr[i][x]);
syntax is console.log
arr.length,
? That's also a typo.
for(var i = 0; i < arr.length; i++){
for(var x = 0; x < arr[i].length; x++){
console.log(arr[i][x]);
}
}
Now what do I need?
[I]
and [x]
?
console.log
with the logic to track the product in the product variable. based on what you have there, you know you access the individual numbers using arr[i][x]
var oldArray = [1,2,3,4,5];
var newArray = [];
// Only change code below this line.
oldArray.map(function(val){
return val + 3;
});
newArray = oldArray;
product = <logicToUpdateProduct>
then return product
at the end of the outter loop
<h2 style="color: red">CatPhotoApp</h2>
<p>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>
var xyz = arr.map(blah blah)
will store whatever you do in your map function in the xyz array.
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for(var i = 0; i < arr.length; i++){
for(var x = 0; x < arr[i].length; x++){
product *= arr[i][x];
}
}
// Only change code above this line
return product;
}
// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Done!
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
myObj.hasOwnProperty("checkProp");
if(checkProp == myObj.hasOwnProperty()){
return checkProp;
}else
return "Not Found";
}
// Test your code by modifying these values
checkObj("gift");
pkshreeman sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 1358 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
if(checkProp == myObj.hasOwnProperty())
the problem with your function is that:
myObj.hasOwnProperty()
does not return a property it returns one of two values, true or false.
// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));
// Only change code below this line
function update(id, prop, value) {
var album = collection[id];
if (value !== "") {
if (album[prop] !== "tracks") {
album[prop] = value;
} else {
album.tracks.push(value);
}
} else {
delete album[prop];
}
return collection;
}
// Alter values below to test your code
update(5439, "artist", "ABBA");
This is from the Record Collection challenge. I have everything working except adding a track: the push action seems to just replace the array with a single string matching the value and I'm not sure what's causing it to do that or how to rewrite the code to make it work properly.
if (myObj.hasOwnProperty(checkProp) ===true)
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) === true){
return checkProp;
}else
return "Not Found";
}
// Test your code by modifying these values
checkObj("gift");
=== true
pkshreeman sends brownie points to @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 463 | @francozt01 | http://www.freecodecamp.com/francozt01
if (album[prop] !== "tracks")
think about what you are trying to check. The album prop or the function parameter prop?
collection[id].tracks.push(value)
and am I still getting the same results.
if (album[prop] !== "tracks")
you just need to check if prop !== "tracks"
basically, when you a variable like
var prop = 'propertyName'
to get a property from an object, you have to put it in brackets
myObj[prop];
where as if you wanted to get a method or object directly out of an object
var myObj = {
property: 'value'
}
return myObj.property
album[]
yet, .
pkshreeman sends brownie points to @centraleft :sparkles: :thumbsup: :sparkles:
:star: 285 | @centraleft | http://www.freecodecamp.com/centraleft
if (prop !== "tracks")
made it work
loganch sends brownie points to @nigeltea and @francozt01 :sparkles: :thumbsup: :sparkles:
:star: 464 | @francozt01 | http://www.freecodecamp.com/francozt01
:star: 316 | @nigeltea | http://www.freecodecamp.com/nigeltea
@alexnissen do you have a class of p
as:
p {
properties: values;
}
in your <style></style>
tag ?
<style>
section anywhere in your code? if not, then what you can do is write an inline styling. Such as <p class=“bla blip boo” style=“color: green”> </p>
<style>
.red-text {
color: red;
}
.font-size {font:16px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p class="red-text" "font-size 16px"> 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>
font-size: 16px
font-size: 16px
.
<style></style>
tag as I said then include font-size:
property and then give its value as 16px;
Trying to wrap my head around this code, damn this broke my cognitive function
function reverseArrayInPlace(array) {
for (var i = 0; i < Math.floor(array.length / 2); i++) {
var old = array[i];
array[i] = array[array.length - 1 - i];
array[array.length - 1 - i] = old;
}
return array;
}
Found on Eloquent Javascript book.
$("#left-well:nth-child(2)").addClass("bounce target");
$("#right-well:nth-child(2)").addClass("bounce target");
.target
instead of #left-well
?
#right-well
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
this is correct , you may have to check if anything else you are missing in your code
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "green");
$(".well:nth-child(2)").addClass("bounce");
});
</script>
<!-- Only change code above 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>
.target
id are mentioned as #target
<style>
.red-text {
color: red;
font-size: 16px; }
</style>
<h2 class="red-text">CatPhotoApp</h2>
<style> .font-size {font-size: 16px; }
</style>
<p class="red-text" "class=font-size:16px" > 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=font-size:16px"> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
class="btn btn-default target"
in any tag there are three classes in this case btn
btn-default
and target
$(".target:nth-child(2)").addClass("bounce");
.target
class as the waypoint instructs you , and you need animated
with bounce
too I suppose.
reduce
takes an array and reduces it to a single value based on the operation you provide
animated
too
.addClass("animated bounce")
, it doesn't show in error? hmm.. It's changed from the last I have used
I can't seem to work out how to change the font size <style>
.red-text {
color: red;
font-size: 16px; }
</style>
[title](http://)
$(".target:nth-child(2)").addClass("animated bounce”);
.well
, remove that $(".well:nth-child(2)").addClass("bounce");
$(".target:nth-child(2)").addClass("bounce”);
@neal1991
Here's how you would give the third element in each well the bounce class:
$(".target:nth-child(3)").addClass("animated bounce");
Make the second child in each of your well elements bounce. You must target the children of element with the target class.
font-size: value;
property just figure out in which class you to change them from next or if have to make a new class
animated bounce
, I think it’s probably because of the well
thing
i reset and its not changing is there some where i can see how its done <style>
.red-text {
color: red;
font-size: 16px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<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>
<style>
up top?
p
tag the font-size
.red-text
instead
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle" ></i>Info</button>
</div>
img
element, like <img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
outline:none;
pxnasty sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 590 | @manish-giri | http://www.freecodecamp.com/manish-giri
edward-hong sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 591 | @manish-giri | http://www.freecodecamp.com/manish-giri
h2 {
font-family: Lobster;
}
p
elements have the class red-text
?
red-text
style overrides the p
style
red-text
class to all p
elements
Hey that’s not ur problem, i completed the challenge you linked by adding the selector for h2
@alexnissen Hey you just have to apply the font to your h2
h2 { font-family: Lobster; }
font-family: Lobster
to h2
not to .red-text
font-family: Monospace!important;
@alexnissen read this
Now you can set Lobster as a font-family value on your h2 element.
@alexnissen This solves your problem
@alexnissen Hey you just have to apply the font to your h2
h2 { font-family: Lobster; }
h2
class should come under <style></style>
tag
@alexnissen i see where u made the mistake
you have the put in your style
<style>
h2 {
font-family: Lobster;
}
</style>
<stlyle>
<h2 {font-family: Lobster;} class="red-text" >CatPhotoApp</h2>
</style>
img class=“smaller-image thick-green-border” src=“..”>
@alexnissen Hey alex seems you’re still confused.
First set the style
<style>
h2 {
font-family: Lobster;
}
<style>
<img src=“image”>
<img src="http://somedomain.com/yourimage.jpg">
it should work
src
attribute of <img>
tag
tanya-giri sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:star: 289 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
varenigmatic sends brownie points to @pkshreeman :sparkles: :thumbsup: :sparkles:
:star: 287 | @pkshreeman | http://www.freecodecamp.com/pkshreeman
varenigmatic sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:star: 290 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
chanty6680 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 97 | @iroachie | http://www.freecodecamp.com/iroachie
<script>
$(document).ready(function() {
$("button").addClass("animated");
$(".btn").addClass("animated");
$("#target1").addClass("animated");
$("#target1").addClass("shake");
$("#target1").addClass("btn-primary");
});
</script>
chanty6680 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: chanty6680 already gave iroachie points
$(document).ready(function() {
$("button").addClass("animated");
$(".btn").addClass("animated shake");
$("#target1").addClass("btn-primary");
})
Only add one class with each of your three selectors.
chanty6680 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:warning: chanty6680 already gave iroachie points
<img class = "smaller-image”>
$("#slide_caption").html(slide_list[count][1]);
<p style="font-size:16px" class="red-text">
rast-7 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 130 | @iroachie | http://www.freecodecamp.com/iroachie
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
return "5 Bet";
}
yasinya sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 426 | @cannelflow | http://www.freecodecamp.com/cannelflow
yasinya sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 132 | @iroachie | http://www.freecodecamp.com/iroachie
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "orange");
$('.well:nth-child(2)').addClass('animated Bounce')
});
</script>
<!-- Only change code above 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>
sarthakadhikari sends brownie points to @yasinya :sparkles: :thumbsup: :sparkles:
:star: 209 | @yasinya | http://www.freecodecamp.com/yasinya
:bulb: to format code use backticks! ``` more info
$(".target").addClass("animated bounce");
$(‘.target:nth-child(2)').addClass('animated bounce’)
sarthakadhikari sends brownie points to @iroachie and @yasinya :sparkles: :thumbsup: :sparkles:
:warning: sarthakadhikari already gave yasinya points
:star: 138 | @iroachie | http://www.freecodecamp.com/iroachie
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "orange");
$("#left-well").children().css("color", "green");
$(".target:nth-child(2)").addClass("animated bounce");
$('.target:even').addClass('animated Shake');
});
</script>
<!-- Only change code above 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>
$(".target:even").addClass("animated shake");
this line of code is solving your problem but try to understand it
sarthakadhikari sends brownie points to @yasinya and @iroachie :sparkles: :thumbsup: :sparkles:
:warning: sarthakadhikari already gave yasinya points
:warning: sarthakadhikari already gave iroachie points
guys, need your suggestion pls. am doing the counting card exercise but now i am stuck. ```
var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
default:
return "Change Me";
}
if (count <= 0) {
console.log(count);
console.log(" Hold");
} else
console.log(count);
console.log(" Bet");
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);```
guys, need your suggestion pls. am doing the counting card exercise but now i am stuck.```
js
var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
default:
return "Change Me";
}
if (count <= 0) {
console.log(count);
console.log(" Hold");
} else
console.log(count);
console.log(" Bet");
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);```
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
```js ⇦ Type 3 backticks and then press [shift + enter ⏎]
(type js or html or css)
<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
js var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 7:
case 8:
case 9:
count += 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
default:
return "Change Me";
}
if (count <= 0) {
console.log(count);
console.log(" Hold");
} else
console.log(count);
console.log(" Bet");
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);
```
function reverseString(str) {
str.split();
}
reverseString("hello");
jsvar count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2,3,4,5,6:
count += 1;
return "5 Bet";
break;
case 7,8,9:
return "0 Hold";
break;
case 10,"J", "Q", "K", "A":
return "-5 Hold";
break;
case 3,2, "A", 10, "K":
return "-1 Hold";
break;
img { width: 32em;}
<img src=" " style="width:32em">
garysa2010 sends brownie points to @yasinya :sparkles: :thumbsup: :sparkles:
:star: 213 | @yasinya | http://www.freecodecamp.com/yasinya
function reverseString(str) {
str.split();
}
reverseString("hello");
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 7:
case 8:
case 9:
count = 0;
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count--;
break;
}
if (count > 0) {
return count + " Bet";
} else {
return count + " Hold";
}
zeroaccess sends brownie points to @yasinya :sparkles: :thumbsup: :sparkles:
:star: 214 | @yasinya | http://www.freecodecamp.com/yasinya
garysa2010 sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 152 | @iroachie | http://www.freecodecamp.com/iroachie
mr-kumar-abhishek sends brownie points to @varenigmatic :sparkles: :thumbsup: :sparkles:
:star: 28 | @varenigmatic | http://www.freecodecamp.com/varenigmatic
hey guys
<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
#orange-text{
color:orange;
}
</style>
<h1 class="pink-text blue-text " id =" orange-text">Hello World!</h1>
why this text dose not change to orange !!
<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>
<div><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>
<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>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>
function reverseString(str) {
var spArray = str.split();
var rv = spArray.reverse();
var j = rv.join("");
return j;
}
reverseString("hello");
div
with a class<div class="some-class">
<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;
}
.container-fluid {
}
</style>
<div class="container-fluid" <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>
<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>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>
-fluid" <
>
in opening of <div class="container-fluid">
fayheim sends brownie points to @mr-kumar-abhishek and @mihai54321 :sparkles: :thumbsup: :sparkles:
:star: 291 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
:star: 232 | @mihai54321 | http://www.freecodecamp.com/mihai54321
split()
function ?
split('')
sukumarkutagulla sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:star: 292 | @mr-kumar-abhishek | http://www.freecodecamp.com/mr-kumar-abhishek
split()
works