What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 21:15:02
javascript regex french phone number
function regexPhoneNumber(str) { const regexPhoneNumber = /^((\+)33|0)[1-9](\d{2}){4}$/; if (str.match(regexPhoneNumber)) { return true; } else { return false; } } let phoneNumber = "+33777777777"; console.log(regexPhoneNumber(phone... Add solution -
PHP 2022-03-27 19:50:03
replace all occurrences of a string in javascript
const p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?'; console.log(p.replaceAll('dog', 'monkey')); // expected output: "The quick brown fox jumps over the lazy monkey. If the monkey reacted, was it really l... Add solution -
Other 2022-03-27 19:45:11
ReferenceError: require is not defined site:stackoverflow.com
const cors = require('cors'); const express = require('express'); const bodyParser = require('body-parser'); var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, { 'Content-Type': 'text/plain' }); ... Add solution -
Javascript 2022-03-27 19:45:09
fetch api with express
const url ='https://example.com'; const headers = { "Content-Type": "application/json", "client_id": "1001125", "client_secret": "876JHG76UKFJYGVHf867rFUTFGHCJ8JHV" } const data = { "... Add solution -
TypeScript 2022-03-27 19:30:45
typescript promise
new Promise<boolean>((res, rej) => { res(true); }) .then(res => { console.log(res); return false; }) .then(res => { console.log(res); return true; }) .then(res => { console.log(res); }) .catch(error => { console.lo... Add solution -
Other 2022-03-27 18:30:09
validar si un numero es par javascript map
// Return a new array where even numbers are multiplied by 2 let arr = [1, 2, 3, 4, 5, 6, 7] function consoleEven(arr) { let data = arr.map((num) => (num % 2 === 0 ? num * 2 : num * 1)) console.log(data) // [1, 4, 3, 8, 5, 12, 7] } // ? is... Add solution
Best helpers
Jean Luis
+5
Terry3497
+5
Aown Ali
+5
Ishan Yadav
+5
SunnyHills
+5
Rocky DeHart
+5
Numeri
+5
Martinako
+5
Eve noonan
+5
Cynthia
+5