Can anyone understand what I'm doing wrong? This code returns the error that "songs is not a function".
<div id="song1" class="song">
<p>some text</p>
</div>
<div id="song2" class="song">
<p>some text</p>
</div>
<div id="song3" class="song">
<p>some text</p>
</div>
const songs = {
song1: '/media/title-song-lala.mp3',
song2: '/media/pva.mp3',
song3: '/media/zjklf.mp3'
};
$('.song').hover(function() {
let song = songs(this.id);
createjs.Sound.play(song);
});
Regards, Shape of Mustard