This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require("request"); | |
| function getTheUrl(data) { | |
| var options = { | |
| url: "https://jsonplaceholder.typicode.com/posts/" + data | |
| } | |
| return options | |
| } | |
| function consoleTheResult(url) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const onHit = (state) => ({ | |
| hit : () => { | |
| if(state.chances === 0){ | |
| return console.log("Game is over"); | |
| } | |
| state.chances -= 1; | |
| state.goalsScored += 1; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const onHit = (state) => ({ | |
| hit : () => { | |
| if(state.chances === 0){ | |
| return console.log("Game is over"); | |
| } | |
| state.chances -= 1; | |
| state.goalsScored += 1; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Player { | |
| constructor(name){ | |
| this.name = name; | |
| this.goalsScored = 0; | |
| this.chances = 10; | |
| } | |
| hit(){ | |
| if(this.chances === 0){ | |
| return console.log("Game is over"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const onHit = (state) => ({ | |
| hit : () => { | |
| if(state.chances === 0){ | |
| return console.log("Game is over"); | |
| } | |
| state.chances -= 1; | |
| state.goalsScored += 1; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Player { | |
| constructor(name){ | |
| this.name = name; | |
| this.goalsScored = 0; | |
| this.chances = 10; | |
| } | |
| hit(){ | |
| if(this.chances === 0){ | |
| return console.log("Game is over"); |
NewerOlder