//Method is indicated by *
//Constructor Function
function BellBoy (name, age, hasWorkPermit, languages) {
this.name = name;
this.age = age;
this.hasWorkPermit = hasWorkPermit;
this.languages = languages;
this.pickUpSuitcase = function() {//*object associated function (method)
console.log('suitcase is picked up')
}
this.move = function() {//*object associated function (method)
console.log(`${this.name} is on the move`)
}
this.moveSuitcase = function() {//*object associated function (method)
alert("May I take your suticase?");
this.pickUpSuitcase(); this.move();
}
}
//Create New Object From Constructor Using Arguments
var bellBoy1 = new BellBoy('Earl E.Bird', 23, true, ['French', 'German'])
//Access the Properties and Their Values
console.log('Name : ', bellBoy1.name)
console.log('Age : ', bellBoy1.age)
console.log('Verified Work Permit : ', bellBoy1.hasWorkPermit)
console.log('Languages : ', bellBoy1.languages)
//calling the method
bellBoy1.moveSuitcase();
//The sort() method sorts an array alphabetically:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.sort();
//output >> [ "Apple",Banana","Mango", "Orange" ]
//if you find the answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)