This file contains 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
var cowsay = require("cowsay"); | |
console.log(cowsay.say({ | |
text : "hello boy", | |
e : "oO", | |
T : "U " | |
})); | |
// or cowsay.think() |
This file contains 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
process.stdin.resume() | |
process.stdin.setEncoding('utf8') | |
console.log('What\'s your age ? ') | |
process.stdin.on('data', (number) => { | |
if (!isNaN(number) && number < 99) { | |
calcul(number); | |
} | |
function calcul(number) { |
This file contains 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 Monster { | |
constructor(options = {}){ | |
this.health = 100; | |
this.name = options.name; | |
} | |
soigner () { | |
this.health = this.health + 10; | |
return this.health; |
This file contains 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 address = { | |
city: "Lyon", | |
state: "FR", | |
zip: 69001 | |
}; | |
const sportList = ['Football', 'BasketBall'] | |
const ortherSportList = ['Boxe', 'Judo'] | |
This file contains 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 address = { | |
city: "Lyon", | |
state: "FR", | |
zip: 69001 | |
}; | |
const sportList = ['Football', 'BasketBall'] | |
const ortherSportList = ['Boxe', 'Judo'] | |
This file contains 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 Animal { | |
} | |
class Chat extends Animal { | |
quatreP: boolean; | |
} | |
class Chien extends Animal { | |
quatreP: boolean; | |
} |
This file contains 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
function hello(name : string) { | |
console.log("Hello " + name); | |
} | |
let firstName = "bob"; | |
hello(firstName); | |
hello(firstName + " marley"); |
This file contains 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
<script> | |
const profile = { | |
name: 'Alex', | |
getName() { | |
return this.name; | |
} | |
}; | |
console.log(profile.getName()); | |
</script> |
This file contains 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
function requestApi (){ | |
var api = "http://api.openweathermap.org/data/2.5/weather?q="; | |
var apiKey = "&APPID=5dbe8aa12a4dde7bbc49a832b7e2d5f7"; | |
var units = "&units=metric"; | |
var eltCity = document.getElementById("city"); | |
var input = eltCity.value; | |
var url = api + input + apiKey + units; | |
This file contains 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
<script> | |
let city = "La Loupe, ou pas !"; | |
let age = "26"; | |
const dateOfBirth = "03/08/1991"; | |
let sentence = `J'habite à ${city}, j'ai ${age} ans, et je suis né le ${dateOfBirth}` | |
console.log(sentence); | |
</script> |
NewerOlder