February 2019
Beginner
694 pages
18h 4m
English
Let's enhance this simple array of contact emails with a little more relevant data. For each of these email addresses, let's assume that we also want to include some text to render within the footer of our page, along with the email addresses. Consider the following HTML <script> tag:
<script type="text/javascript">
var CONTACT_DATA = [
{ DisplayText: 'Help',
Email: 'help@site.com' } ,
{ DisplayText: 'Contact Us',
Email: 'contactus@site.com' },
{ DisplayText: 'Webmaster',
Email: 'webmaster@site.com' }
];
</script>
Here, we have defined a global variable, named CONTACT_DATA, that is an array of objects. Each object has a property named DisplayText and a property named Email. If we are to use this array within our TypeScript ...
Read now
Unlock full access