-
-
Save ankitamasand/5a0701ef74be1f5b74f48c8f0249052b to your computer and use it in GitHub Desktop.
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 manufactureCar (type) { | |
const model = function getModel (type) { | |
console.log('inside getModel function') | |
// get the model of type as mentioned in the argument | |
} | |
model.getCustomerDetails = function () { | |
console.log('inside customer details function') | |
// get the details of customer who has purchased this model | |
} | |
model.price = 100000 | |
model.trackDelivery = function () { | |
console.log('inside trackDelivery function') | |
// track the delivery of the model | |
} | |
return model | |
} | |
let tesla = manufactureCar('tesla') | |
tesla() // tesla is a function | |
tesla.getCustomerDetails() // getCustomerDetails is a property defined on function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment