Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @name Function with too many parameters
- * @description Functions with many parameters are hard to read and hard to use.
- */
- function sendRecord(firstName, lastName, dateOfBirth, streetAddress, postCode, city, country, email, website) {
- sendResponse({
- name: lastName + ', ' + firstName,
- DOB: dateOfBirth,
- address: streetAddress + '\n' + postCode + ' ' + city + '\n' + country,
- email: email,
- url: website
- });
- }
- //better
- function sendRecord(record) {
- sendResponse({
- name: record.lastName + ', ' + record.firstName,
- DOB: record.dateOfBirth,
- address: record.streetAddress + '\n'
- + record.postCode + ' ' + record.city + '\n'
- + record.country,
- email: record.email,
- url: record.website
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement