i am kinda new to javascript and i am stuck at a javascript for-loop exercise, the problem is i need to return the filled in telephone number to text it have to look like this:
(this is just an example)
filled in number: 0332141 how i have to return it: zero - three - three - two - one - four - one
This is the code i already have and i have to use this:
<!DOCTYPE html>
<html lang = "nl">
<head>
<meta http-equiv="Content-Type"
content="text/html"
charset=UTF-8/>
<title>Lab11/title>
</head>
<body>
<script>
var number = new Array();
number[0] = 'zero';
number[1] = 'one';
number[2] = 'two';
number[3] = 'three';
number[4] = 'four';
number[5] = 'five';
number[6] = 'six';
number[7] = 'seven';
number[8] = 'eight';
number[9] = 'nine';
var phonenumber = prompt('What is youre phonenumber?');
document.write('<br> your phonenumber is: ' + phonenumber);
</script>
</body>
</html>
but this ofcourse only shows the digits, so as the example above i need to return the digits in words, any ideas on how to do this?