Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const randomSound = () => {
- const audio = [
- new Audio("../audio/max_cat_1.mp3"),
- new Audio("../audio/max_cat_2.mp3"),
- new Audio("../audio/max_cat_3.mp3"),
- new Audio("../audio/max_cat_4.mp3")
- ];
- const randomSound = Math.floor(Math.random() * (audio.length - 1));
- return audio[randomSound];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement