Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script id="jsbin-javascript">
- var getPhoneDescription;
- var buildPhone;
- var phone1;
- var phone2;
- buildPhone = function(brand,name,battery) {
- return {
- brand: brand,
- name: name,
- battery: battery
- };
- };
- getPhoneDescription = function(phone){
- return phone.brand + " brings the new" + phone.name + " with " + phone.battery + " hours of battery life!"
- };
- phone1=buildPhone("Samsung"," Galaxy S10+",23);
- phone2=buildPhone("Apple"," iPhone 11s", 27);
- console.log(getPhoneDescription(phone1));
- console.log(spacer.blank);
- console.log(getPhoneDescription(phone2));
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">var getPhoneDescription;
- var buildPhone;
- var phone1;
- var phone2;
- buildPhone = function(brand,name,battery) {
- return {
- brand: brand,
- name: name,
- battery: battery
- };
- };
- getPhoneDescription = function(phone){
- return phone.brand + " brings the new" + phone.name + " with " + phone.battery + " hours of battery life!"
- };
- phone1=buildPhone("Samsung"," Galaxy S10+",23);
- phone2=buildPhone("Apple"," iPhone 11s", 27);
- console.log(getPhoneDescription(phone1));
- console.log(spacer.blank);
- console.log(getPhoneDescription(phone2));
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement