get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
I can already see Google coming up with a coder's autocorrect:
wafn 90823u fhfj j02jf0ija
Did you mean?
console.log('Hello World!');
FCC was one of the program to run on a turning mahcine
~wiki
@anandpotukchi it's a trick they use to remeber them easily.
I think it's linked to the fact that old phones used to have the letters on numbers.
So you should know each number which letters holds. That's why I still have my old Nokia :smile:
2 = ABC / 3 = DEF
and so on
createElement()
import React, { Component } from 'react'
function fun() {
alert('hello')
}
class Form extends Component {
constructor(props) {
super(props)
this.state = {
name : ''
}
}
onSubmit = (e, fun) => {
fun()
}
onChange = (e) => {
this.setState({name : e.target.value})
}
render() {
return (
<div>
<form onSubmit ={this.onSubmit.bind(fun)}>
<label htmlFor = "name">Name:</label>
<input type = "text" onChange = {this.onChange.bind(this)} value = {this.state.name} />
<input type= "submit" value = "add" />
</form>
<h1>{this.state.name}</h1>
</div>
)
}
}
export default Form
onSubmit = (e, fun) => {
e.preventDefault();
fun()
}
onSubmit={this.onSubmit}
function Dog(name, numLegs) {
this.name = name;
}
Dog.prototype.numLegs = 4;
let beagle = new Dog("Snoopy");
let ownProps = [];
let prototypeProps = [];
// Add your code below this line
for (let property in Dog) {
if(Dog.hasOwnProperty(property)) {
ownProps.push(property);
} else {
prototypeProps.push(property);
}
}
typeof Dog // 'function'
function Animal() { }
Animal.prototype = {
constructor: Animal,
eat: function() {
console.log("nom nom nom");
}
};
// Add your code below this line
let duck = Object.create(Animal.prototype); // Change this line
let beagle = = Object.create(Animal.prototype); // Change this line
function Animal() { }
Animal.prototype.eat = function() {
console.log("nom nom nom");
};
let animal = new Animal();
let animal = Object.create(Animal.prototype);
animal.eat(); // prints "nom nom nom"
animal instanceof Animal;
const { property: { anotherProperty: variableName } } = object;
function Animal() { }
Animal.prototype = {
constructor: Animal,
eat: function() {
console.log("nom nom nom");
}
};
// Add your code below this line
let duck = Object.create(Animal.prototype); // Change this line
let beagle = = Object.create(Animal.prototype); // Change this line
function Animal() { }
Animal.prototype.eat = function() {
console.log("nom nom nom");
};
let animal = new Animal();
let animal = Object.create(Animal.prototype);
animal.eat(); // prints "nom nom nom"
animal instanceof Animal;
LOCAL_FORECAST.tomorrow.max
forecast
in this case
beagle
is declared incorrectly, and you're declaring animal
twice, once by constructor, another by cloning/
LOCAL_FORECAST.tomorrow.max
you can create a variable like this const { max } = LOCAL_FORECAST.tomorrow
so now you can use max
instead of LOCAL_FORECAST.tomorrow.max
everytime you want to use the value associated with that property.
const { maxOfTomorrow } = LOCAL_FORECAST.tomorrow.max
const { max: maxOfTomorrow } = LOCAL_FORECAST.tomorrow.max
LOCAL_FORECAST = { tomorrow: { max: { max: value} } }
const { tomorrow: {max} } = LOCAL_FORECAST
const { [param] } = someObject
?
@ke1echiconst { property: { anotherProperty: variableName } } = object;
i dont understand what you meant here @thekholm80
object = { property: { anotherProperty: value } }
and you want to assign anotherProperty
to varialbleName
then you would destructure it as const { property: { anotherProperty: variableName } } = object;
anotherProperty
into a new variable called variableName
getMaxOfTmrw()
there's a function parameter called forecast
that is structured similarly
async(_, params, context) {
then down in the code either refer to things as context.mongo.Users
or destructure somewhere inside the function itself
this
that way, too because i get tired of writing this.
a million times in every method
const { tomorrow: { max: maxOfTomorrow}} = LOCAL_FORECAST
forecast
instead of LOCAL_FORECAST
// change code below this line
const resultDisplayArray = [];
resultDisplayArray.push(`<li class="text-warning">${result.failure[0]}</li>`);
resultDisplayArray.push(`<li class="text-warning">${result.failure[1]}</li>`)
resultDisplayArray.push(`<li class="text-warning">${result.failure[2]}</li`);
// change code above this line
let
instead of const
if you want to change the value of the variable, array or object later on in your code.
const
doesnt mean constant sadly, objects can be mutated.
result.failure
as arr
to the function so you'll need to usearr[0]
and so on
>
missing in </li
const a = [1, 2, 3];
{
const a = "abc";
}
@ezioda004 quick! without looking
.red {
color: red;
}
.blue {
color: blue;
}
Which color would these divs be?
<div class="red blue">
<div class="blue red">
{}
create new scope?
const a = "abc";
{
const a = a.split(""); //Error
}
Well... i'v already watched the first episode... might as well finish the season
that's nice way of thinking
"use strict";
import * as capString from capitalize_strings;
When I look @ chocolate I hear 2 voices in my head.
First one says : *You need to eat that chocolate.*
The other voice goes: *You heard. Eat the chocolate.*
capitalize_strings
['|"]
yeah, they use regex to parse the user-generated code. they just need to expand their test to include['|"]
since node is written in c/c++''
is used to refer to achar
@thekholm80
''
lol
@thekholm80
If it looks like a chicken, acts like a chicken, it must be a chicken
npm update <package-name>
npm update
if they're global, npm -g update
or you can go package by package with npm update [-g] <package>