Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 20 21:20
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:15
    @bjorno43 banned @vnikifirov
I cant do it
Bjorn van de Peut
@bjorno43
@channinghall You should probably join our Help or HelpJavaScript rooms for that. We use this room to play JS challenges :)
Anne L
@mathisme
This message was deleted
I really don’t think you need Promises to solve this challenge
This message was deleted
Anne L
@mathisme
@bobsbotty challenge
bobsbotty
@bobsbotty

@mathisme The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

Anne L
@mathisme
i typed this in notes on my ipad and haven’t tested so it might not work lol

@bobsbotty solve

‘’’
function rgb() {
var hex = ‘’;
for (a = 0; a < 3; a++)
{
if (arguments[a] < 0) {arguments[a] = 0;}
else if (arguments[a] > 255) {arguments[a] = 255;}
hex += Math.round(arguments[a]).toString(16);

}
return hex;
}
‘’’

bobsbotty
@bobsbotty
@mathisme Please provide your solution between 3 backticks.
Anne L
@mathisme
@bobsbotty solve
function rgb(r, g, b) { 
var hex = ‘’;
for (a = 0; a < 3; a++) 
{
   if (arguments[a] < 0) {arguments[a] = 0;}
   else if (arguments[a] > 255) {arguments[a] = 255;}
   hex += Math.round(arguments[a]).toString(16);

}
return hex;
}
bobsbotty
@bobsbotty
@mathisme There was an error with your Javascript code:
V8Js::compileString():3: SyntaxError: Invalid or unexpected token
Anne L
@mathisme
ugh, dumb ipad
michel perez
@MichelPra
class CampSite extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <Camper/>
      </div>
    );
  }
};
// change code below this line
const Camper = props => (<p>{props.name}</p>);
Camper.defaultProps = {name: `CamperBot`
};
Camper.PropTypes = {name: PropTypes.string.isRequired
};
anyone knows why this code don't pass the tests?
Randell Dawson
@RandellDawson
What challenge is it for?
anterior don't pass too and seems to be fine :-(
Randell Dawson
@RandellDawson
You have two issues (one real and the other fcc test being picky). The real problem is you are not using the correct method to define the the propTypes. You have a typo. The other issue is currently the tests are not recognizing the single backticks as a string. Try single or double quotes.
michel perez
@MichelPra
yep just seen , so i cannot pass all the test ?
just now
so this is's a problem of fcc test no? syntax with single ticks are right
Randell Dawson
@RandellDawson
You can pass the tests if you change the backticks to single or double quotes and use the correct spelling of the protoTypes method.
michel perez
@MichelPra
thx ;-)
michel perez
@MichelPra
const Camper = props => (<p>{props.name}</p>);
Camper.defaultProps={name: `CamperBot`};
Camper.propTypes = {name:PropTypes.string.isRequired};
someone knows why don't evaluate?
i cannot see the type error
Bjorn van de Peut
@bjorno43
@10vivar May I suggest you join our Help and / or HelpJavascript room for these questions? You're much more likely to get an answer there as this room is used for JS Challenges with our Bot @bobsbotty :) It might even be better to join our forums
michel perez
@MichelPra
uups i read challenges and thinking it's related to the challenges of the course , there it's s a link to the original purpose of this room ? thx
Bjorn van de Peut
@bjorno43
michel perez
@MichelPra
thanks interesting work ! i suggest you change the name of the room in order to avoid more spammers like me ! maybe some related with the git link?
JJ Megma
@megma_jj_twitter
Someone in Discord told me to post this link here https://app.codesignal.com/tournaments/RTnYKWZoxrAc7ZNB5
Precious adeyinka
@precious-adeyinka
Hello
:+1:
No one is here?
faisaldanan
@faisaldanan
hello
Precious adeyinka
@precious-adeyinka
Hello @faisaldanan
huanhuacf
@huanhuacf
hello
<script>
var arr=[
{s:'A1',t:'B1'},
{s:'A1',t:'B2'},
{s:'B1',t:'C1'},
{s:'B1',t:'C2'}
]
console.log(arr)

var arr1=[['A1'],['B1','B2'],['C1','C2']]
console.log(arr1)
</script>
How can I convert arr to arr1?
Victor
@abeledovictor
First you can use Object.values to turn those objects to an array
@huanhuacf
Burhan Maseel
@burhanmaseel
Can anyone help me with nodejs? I have an issue with setting a base path.. I am uploading images using FS (File System)
Anders Nicolai Magnussen
@andersnicolaimagnussen
Hi
anyone that have experience with react here?
and typescript :)
for some reason I get the error, that I it doesn't accept the list
the component file 
file 2
interface IProps {
    open: boolean;
    title: string;
    content: string;
    marvinFragmentSize: number;
    cancelCaption?: string;
    okCaption?: string;
    onOkClick: () => void;
    onCancelCLick: () => void;
    ISentimentList: ISentimentConfigItem;
    //testList: { title: string, content: string, marvinFragmentSize: number }[];
}

interface ISentimentConfigItem {
    title: string;
    content: string;
    marvinFragmentSize: number;
}

export interface IMyInterface extends Array<ISentimentConfigItem> {
}


file 1
  const test = [{
            title: "dd",
            content: "dd",
            marvinFragmentSize: 23,
        }, {
            title: "dd",
            content: "dd",
            marvinFragmentSize: 23,
        }];
Anders Nicolai Magnussen
@andersnicolaimagnussen
My bad, I picked the item, and not the IMyInterface ;haha
Dmitriy
@dmitriy.__gitlab
Hey Guys, i wanna enhance my skills in react and any other technologies like redux, mobx, react-native etc. And i looking for internship or junior position. Maybe first time for free. I'll be glad to any suggestions