Skip to content

Instantly share code, notes, and snippets.

@sleroy
Created July 22, 2020 20:22
Show Gist options
  • Save sleroy/725bee371b454eba8d45d64966a264a7 to your computer and use it in GitHub Desktop.
Save sleroy/725bee371b454eba8d45d64966a264a7 to your computer and use it in GitHub Desktop.
Code example for Ponicode
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