Created
July 22, 2020 20:22
-
-
Save sleroy/725bee371b454eba8d45d64966a264a7 to your computer and use it in GitHub Desktop.
Code example for Ponicode
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 addition(operandA, operandB) { | |
return operandA + operandB; | |
} | |
function fullName(firstName, lastName) { | |
return firstName + " " + lastName; | |
} | |
function isFrenchPhoneNumber(phoneNumber) { | |
return phoneNumber.startsWith("+33"); | |
} | |
function isEvenNumber(value) { | |
return value % 2 == 0; | |
} | |
function isEvenNumber(value) { | |
return value % 2 == 0; | |
} | |
const complexStructure = { | |
firstName: "Sylvain", | |
lastName: "Leroy", | |
dateOfBirth: "13/06/1983" | |
} | |
function isFormValid() { | |
if (this.firstName.trim().isEmpty()) return false; | |
if (this.firstName.trim().isEmpty()) return false; | |
if (!this.dateOfBirth) return false; | |
if (new Date(dateOfBirth).getFullYear() <= 2001) return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment