Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <script id="jsbin-javascript">
  2. var getPhoneDescription;
  3. var buildPhone;
  4. var phone1;
  5. var phone2;
  6.  
  7. buildPhone = function(brand,name,battery) {
  8. return {
  9. brand: brand,
  10. name: name,
  11. battery: battery
  12. };
  13. };
  14.  
  15. getPhoneDescription = function(phone){
  16. return phone.brand + " brings the new" + phone.name + " with " + phone.battery + " hours of battery life!"
  17. };
  18.  
  19. phone1=buildPhone("Samsung"," Galaxy S10+",23);
  20. phone2=buildPhone("Apple"," iPhone 11s", 27);
  21.  
  22. console.log(getPhoneDescription(phone1));
  23. console.log(spacer.blank);
  24. console.log(getPhoneDescription(phone2));
  25. </script>
  26.  
  27.  
  28. <script id="jsbin-source-javascript" type="text/javascript">var getPhoneDescription;
  29. var buildPhone;
  30. var phone1;
  31. var phone2;
  32.  
  33. buildPhone = function(brand,name,battery) {
  34. return {
  35. brand: brand,
  36. name: name,
  37. battery: battery
  38. };
  39. };
  40.  
  41. getPhoneDescription = function(phone){
  42. return phone.brand + " brings the new" + phone.name + " with " + phone.battery + " hours of battery life!"
  43. };
  44.  
  45. phone1=buildPhone("Samsung"," Galaxy S10+",23);
  46. phone2=buildPhone("Apple"," iPhone 11s", 27);
  47.  
  48. console.log(getPhoneDescription(phone1));
  49. console.log(spacer.blank);
  50. console.log(getPhoneDescription(phone2));
  51.  
  52.  
  53.  
  54.  
  55.  
  56. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement