get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
thekholm80 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2382 | @darrenfj |http://www.freecodecamp.org/darrenfj
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1688 | @thekholm80 |http://www.freecodecamp.org/thekholm80
body (
background-color: lightblue;
)
{ }
instead of ( )
type="type/css"
out of your <style>
tag it works
document.write()
for all of this?
write
used after a page is loaded will destroy the HTML and replace it.write
besides for testing or for some funky new tabs creation
document.write
will be like a brand new page. So if you want to use it as it is, you have to write the head as well
jeddionido sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1150 | @marmiz |http://www.freecodecamp.org/marmiz
pppppsssst... i told you how a second ago:
Jut to make it simple, everything you use in
document.write
will be like a brand new page. So if you want to use it as it is, you have to write the head as well
:shipit:
write
was with window.open
to test a backend feature :)
querySelector
and appendChild
stuff
olapri sends brownie points to @thekholm80 and @sjames1958gm and @heinoustugboat :sparkles: :thumbsup: :sparkles:
:star2: 8953 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
:cookie: 341 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
:star2: 1689 | @thekholm80 |http://www.freecodecamp.org/thekholm80
[i]
to the source[keySource[i]] !== item[keySource])
- make it source[keySource[i]] !== item[keySource[i]])
keySource[i]
in your inner loop.
true
when there is only a single match, it is not fully testing all of the sub-object properties - for example, the source
in your test case above has { "a": 1, "b": 2 }
and the second object in the array only consists of { "a": 1 }
. Unless you determine that the second key/value "b": 1
exists and matches in the item, you will not get the correct result. so you don't want to return true
in that case...
source[keySource[i]] !== item[keySource])
since keySource
is an array. That can be solved with source[keySource[i]] !== item[keySource[i]])
now with the second problem of it returning true
too early, that can be solved with having return true
outside the loop so something like this.for(var i = 0; i < keySource.length; i++) {
if(!item.hasOwnProperty(keySource[i]) || source[keySource[i]] !== item[keySource[i]]){
return false;}
else {}
}
return true;
olapri sends brownie points to @ezioda004 and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 446 | @ezioda004 |http://www.freecodecamp.org/ezioda004
:star2: 3723 | @khaduch |http://www.freecodecamp.org/khaduch
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main (void)
{
float f = 0;
//prompt user for a valid input
do
{
f = get_float("How much do we owe you?: \n");
}
while (f < 0);
printf("%f\n", f);
}
float f;