I think i pass the 11 test i dont know what happens?
https://codepen.io/freeCodeCamp/pen/MJjpwO
Unfortunately the link you provided doesn’t have any code yet.
import React from "https://cdn.skypack.dev/react"
import ReactDOM from "https://cdn.skypack.dev/react-dom"
class App extends React.Component{
constructor(props){
super(props)
this.state={
estado: '0',
estadoAnterior: 0,
estadoActual: 0,
operacion: '',
hubopunto: false
}
this.limpiar=this.limpiar.bind(this);
this.apreta0=this.apreta0.bind(this);
this.apreta1=this.apreta1.bind(this);
this.apreta2=this.apreta2.bind(this);
this.apreta3=this.apreta3.bind(this);
this.apreta4=this.apreta4.bind(this);
this.apreta5=this.apreta5.bind(this);
this.apreta6=this.apreta6.bind(this);
this.apreta7=this.apreta7.bind(this);
this.apreta8=this.apreta8.bind(this);
this.apreta9=this.apreta9.bind(this);
this.apretaMas=this.apretaMas.bind(this);
this.apretaMenos=this.apretaMenos.bind(this);
this.apretaDividido=this.apretaDividido.bind(this);
this.apretaMultiplicacion=this.apretaMultiplicacion.bind(this);
this.apretaIgual=this.apretaIgual.bind(this);
this.apretopunto=this.apretopunto.bind(this);
}
apretopunto(){
if(this.state.hubopunto===false){
this.setState({
estado: this.state.estado+'.',
hubopunto: true
})
}}
apretaIgual(){
const numero=this.state.estado;
let terminos=[];
terminos=numero.split()
}
apretaMas(){
this.setState({
estado: this.state.estado+'+',
hubopunto: false
})
}
apretaMenos(){
this.setState({
estado: this.state.estado+'-',
hubopunto: false
})
}
apretaMultiplicacion(){
this.setState({
estado: this.state.estado+'*',
hubopunto: false
})
}
apretaDividido(){
this.setState({
estado: this.state.estado+'/',
hubopunto: false
})
}
limpiar(){
this.setState(
{
estado: '0'
}
)
}
apreta0(){
if(this.state.estado==='0'){
this.setState({
estado: '0'
})
}else{
this.setState({
estado: this.state.estado+'0'
})
}
}
apreta1(){
if(this.state.estado==='0'){
this.setState({
estado: '1'
})
}else{
this.setState({
estado: this.state.estado+'1'
})
}
}
apreta2(){
if(this.state.estado==='0'){
this.setState({
estado: '2'
})
}else{
this.setState({
estado: this.state.estado+'2'
})
}
}
apreta3(){
if(this.state.estado==='0'){
this.setState({
estado: '3'
})
}else{
this.setState({
estado: this.state.estado+'3'
})
}
}
apreta4(){
if(this.state.estado==='0'){
this.setState({
estado: '4'
})
}else{
this.setState({
estado: this.state.estado+'4'
})
}
}
apreta5(){
if(this.state.estado==='0'){
this.setState({
estado: '5'
})
}else{
this.setState({
estado: this.state.estado+'5'
})
}
}
apreta6(){
if(this.state.estado==='0'){
this.setState({
estado: '6'
})
}else{
this.setState({
estado: this.state.estado+'6'
})
}
}
apreta7(){
if(this.state.estado==='0'){
this.setState({
estado: '7'
})
}else{
this.setState({
estado: this.state.estado+'7'
}
)
}}
apreta8(){
if(this.state.estado==='0'){
this.setState({
estado: '8'
})
}else{
this.setState({
estado: this.state.estado+'8'
})
}
}
apreta9(){
if(this.state.estado === '0'){
this.setState({
estado: '9'
})
}else{
this.setState({
estado: this.state.estado+'9'
})
}
}
render(){
return(
<div>
<h1>calculadora</h1>
<button id="equals" onClick={this.apretaIgual}>=</button>
<button id="zero" onClick={this.apreta0}>0</button>
<button id="one" onClick={this.apreta1}>1</button>
<button id="two" onClick={this.apreta2}>2</button>
<button id="three" onClick={this.apreta3}>3</button>
<button id="four" onClick={this.apreta4}>4</button>
<button id="five" onClick={this.apreta5}>5</button>
<button id="six" onClick={this.apreta6}>6</button>
<button id="seven" onClick={this.apreta7}>7</button>
<button id="eight" onClick={this.apreta8}>8</button>
<button id="nine" onClick={this.apreta9}>9</button>
<button id="add" onClick={this.apretaMas}>+</button>
<button id="subtract" onClick={this.apretaMenos}>-</button>
<button id="multiply" onClick={this.apretaMultiplicacion}>*</button>
<button id="divide" onClick={this.apretaDividido}>/</button>
<button id="decimal" onClick={this.apretopunto}>.</button>
<button id="clear" onClick={this.limpiar}>clear</button>
<h1 id="display">{this.state.estado}</h1>
</div>
)
}
}
ReactDOM.render(<App/>,document.getElementById("root"));
I think i pass the 11 test i dont know what happens?
https://codepen.io/freeCodeCamp/pen/MJjpwO
Your link is the link to the template of FCC (the one you find in the exercise).
You need to go to your codepen pens (Menu → “Your Work”) and post the link to your pen again.
The js code alone probably won’t help anyone and as advice for the future:
Could be helpful to use english variable names in your programs so people who don’t speak/read spanish can read your code (and help) better