Guest User

Untitled

a guest
Jan 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. //JavaScript Homework 1 "Whats your favourite song"
  12.  
  13. //constructor method for creating various artists object
  14. "use strict";
  15.  
  16. function artistConstructor(singerName, noOfSongs) {
  17. this.singerName = singerName;
  18. this.noOfSongs = noOfSongs;
  19. }
  20.  
  21. //first singer details
  22. var singer1 = new artistConstructor("Malkit Singh", 3);
  23. //second singer details
  24. var singer2 = new artistConstructor("Alka", 3);
  25.  
  26. //this is the song name
  27. var songName = "Jind Mahi";
  28. //album to which song belongs
  29. var Album = "Bend It Like Beckham";
  30. //array of singers objects
  31. var AlbumArtists = [singer1, singer2];
  32. //array of producers
  33. var Producers = ["Raj", "Simran"];
  34. //array of music composers
  35. var MusicComposers = ["Anand", "Milind"];
  36. //rating of song on charts
  37. var Rating = 4;
  38. //category of song
  39. var Genre = "Pop";
  40. //writers of song
  41. var Writers = ["Rehman", "shekhar"];
  42. //year in which song was released
  43. var Year = "2000";
  44. //duration of song in sec
  45. var Duration = 230;
  46. //track number of song in album
  47. var TrackNumber = 2;
  48.  
  49. console.log(songName);
  50. console.log(Album);
  51. console.log(AlbumArtists);
  52. console.log(Producers);
  53. console.log(MusicComposers);
  54. console.log(Rating);
  55. console.log(Genre);
  56. console.log(Writers);
  57. console.log(Year);
  58. console.log(Duration);
  59. console.log(TrackNumber);
  60. </script>
  61.  
  62.  
  63.  
  64. <script id="jsbin-source-javascript" type="text/javascript">//JavaScript Homework 1 "Whats your favourite song"
  65.  
  66. //constructor method for creating various artists object
  67. function artistConstructor(singerName , noOfSongs){
  68. this.singerName = singerName;
  69. this.noOfSongs = noOfSongs;
  70. }
  71.  
  72. //first singer details
  73. var singer1 = new artistConstructor("Malkit Singh",3);
  74. //second singer details
  75. var singer2 = new artistConstructor("Alka",3);
  76.  
  77. //this is the song name
  78. var songName = "Jind Mahi";
  79. //album to which song belongs
  80. var Album = "Bend It Like Beckham";
  81. //array of singers objects
  82. var AlbumArtists = [singer1,singer2];
  83. //array of producers
  84. var Producers = ["Raj","Simran"];
  85. //array of music composers
  86. var MusicComposers = ["Anand","Milind"];
  87. //rating of song on charts
  88. var Rating = 4;
  89. //category of song
  90. var Genre = "Pop";
  91. //writers of song
  92. var Writers = ["Rehman","shekhar"];
  93. //year in which song was released
  94. var Year = "2000";
  95. //duration of song in sec
  96. var Duration = 230;
  97. //track number of song in album
  98. var TrackNumber = 2;
  99.  
  100. console.log(songName);
  101. console.log(Album);
  102. console.log(AlbumArtists);
  103. console.log(Producers);
  104. console.log(MusicComposers);
  105. console.log(Rating);
  106. console.log(Genre);
  107. console.log(Writers);
  108. console.log(Year);
  109. console.log(Duration);
  110. console.log(TrackNumber);
  111.  
  112.  
  113.  
  114.  
  115. </script></body>
  116. </html>
Add Comment
Please, Sign In to add comment