Skip to content

Instantly share code, notes, and snippets.

@sleroy sleroy/example.js

Created Jul 22, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.