Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- //JavaScript Homework 1 "Whats your favourite song"
- //constructor method for creating various artists object
- "use strict";
- function artistConstructor(singerName, noOfSongs) {
- this.singerName = singerName;
- this.noOfSongs = noOfSongs;
- }
- //first singer details
- var singer1 = new artistConstructor("Malkit Singh", 3);
- //second singer details
- var singer2 = new artistConstructor("Alka", 3);
- //this is the song name
- var songName = "Jind Mahi";
- //album to which song belongs
- var Album = "Bend It Like Beckham";
- //array of singers objects
- var AlbumArtists = [singer1, singer2];
- //array of producers
- var Producers = ["Raj", "Simran"];
- //array of music composers
- var MusicComposers = ["Anand", "Milind"];
- //rating of song on charts
- var Rating = 4;
- //category of song
- var Genre = "Pop";
- //writers of song
- var Writers = ["Rehman", "shekhar"];
- //year in which song was released
- var Year = "2000";
- //duration of song in sec
- var Duration = 230;
- //track number of song in album
- var TrackNumber = 2;
- console.log(songName);
- console.log(Album);
- console.log(AlbumArtists);
- console.log(Producers);
- console.log(MusicComposers);
- console.log(Rating);
- console.log(Genre);
- console.log(Writers);
- console.log(Year);
- console.log(Duration);
- console.log(TrackNumber);
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">//JavaScript Homework 1 "Whats your favourite song"
- //constructor method for creating various artists object
- function artistConstructor(singerName , noOfSongs){
- this.singerName = singerName;
- this.noOfSongs = noOfSongs;
- }
- //first singer details
- var singer1 = new artistConstructor("Malkit Singh",3);
- //second singer details
- var singer2 = new artistConstructor("Alka",3);
- //this is the song name
- var songName = "Jind Mahi";
- //album to which song belongs
- var Album = "Bend It Like Beckham";
- //array of singers objects
- var AlbumArtists = [singer1,singer2];
- //array of producers
- var Producers = ["Raj","Simran"];
- //array of music composers
- var MusicComposers = ["Anand","Milind"];
- //rating of song on charts
- var Rating = 4;
- //category of song
- var Genre = "Pop";
- //writers of song
- var Writers = ["Rehman","shekhar"];
- //year in which song was released
- var Year = "2000";
- //duration of song in sec
- var Duration = 230;
- //track number of song in album
- var TrackNumber = 2;
- console.log(songName);
- console.log(Album);
- console.log(AlbumArtists);
- console.log(Producers);
- console.log(MusicComposers);
- console.log(Rating);
- console.log(Genre);
- console.log(Writers);
- console.log(Year);
- console.log(Duration);
- console.log(TrackNumber);
- </script></body>
- </html>
Add Comment
Please, Sign In to add comment