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
| - seule occurrence du deuxième prénom de Néo (soit le A. de "Thomas A. Anderson): /A\./ | |
| - expression régulière qui cherche la date contenue dans le document : /[0-9]{2}\/[0-9]{2}\/[0-9]{4}/g | |
| - note contenue dans le texte, sans pour autant sélectionner une partie de la date: / +[0-9]{1}\/[0-9]{2}/g | |
| - expression régulière qui renvoie les mots ayant au moins 14 caractères: /[a-z]{14,}/gi | |
| - expression régulière qui correspond à l'url de la fiche du film sur IMDB: |
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
| function fuelPrice(litres, pricePerLiter) { | |
| switch(litres){ | |
| case litres >= 10: | |
| pricePerLiter = pricePerLiter - 25; | |
| break; | |
| case litres >= 8: | |
| pricePerLiter = pricePerLiter - 20; | |
| break; | |
| case litres >= 6: | |
| pricePerLiter = pricePerLiter -15; |
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 filmTitle = 'C\'est arrivé près de chez vous '; | |
| const year= 1992; | |
| const movieDirector = ' Remy Belvaux'; | |
| alert(filmTitle + year + movieDirector); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <script src="person.js"></script> | |
| </body> |
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
| process.stdin.resume() | |
| process.stdin.setEncoding('utf8') | |
| console.log('What\'s your age ? ') | |
| process.stdin.on('data', (age) => { | |
| const year = new Date().getFullYear(); | |
| const birthYear = year - age; | |
| if(age <= 99 && isNaN(age)==false && birthYear<year){ | |
| console.log("Vous êtes né en : " + (year - age)); |
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 cowsay = require('cowsay'); | |
| console.log(cowsay.say({ | |
| text : "hello boy", | |
| })); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.1/redux.min.js"></script> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <h1>Redux counter</h1> |
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 http = require('http'); | |
| const url = require('url'); | |
| const port = 8000; | |
| const requestHandler = (request, response) => { | |
| const urlObj = url.parse(request.url, true).query | |
| if(urlObj.name && urlObj.city){ | |
| response.end(`Hello ${urlObj.name} How are you in your beautiful city of ${urlObj.city}!!!!`); | |
| } else { |
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 express = require('express'); | |
| const app = express(); | |
| const port = 3000; | |
| app.get('/api/movies', (req, res) => { | |
| res.send('Récupération de tous les films'); | |
| }); | |
| app.get('/api/movies/:id', (req, res) => { |
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
| function hello(name: string) { | |
| console.log("Hello " + name); | |
| } | |
| var firstName = "bob"; | |
| hello(firstName); | |
| hello(firstName + " marley"); | |
| function concat(a: string, b: string) { |