Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.

I cannot get Ques 7 in the JavaScript Function Tutorial to work? Help!

+7 votes
Javascript Object Notation

Examine and try out the following code:var freesvs = {s1: "IPv6 certification",s2: "Tunnelbroker",s3: "DNS", arr:['ipv6.he.net', 'tunnelbroker.net', 'dns.he.net'],fn: function() {document.write('This is a function()');}}freesvs.s1;

How can this be fixed?
posted 12 years ago in Javascript by Heidi Vincent (3,970 points)

1 Answer

+1 vote
Hi,

If you post the actual exercise and the result, it would be easier for me to diagnose your issue.

I've tried the same code and got the below result:

Code I ran:

var freesvs = {
    s1: "IPv6 certification",
    s2: "Tunnelbroker",
    s3: "DNS",
    arr:['ipv6.he.net', 'tunnelbroker.net', 'dns.he.net'],
    fn: function() {document.write('This is a function()');}
}
freesvs.s1;

Result:
IPv6 certification

Is your result different from mine?
answered 12 years ago by codeadmin (113,880 points)
Thaks for your response but the result I get is:

Error: Expected ';'
And here is the Exercise in its entirety:
Javascript Object NotationExamine and try out the following code:var freesvs = {s1: "IPv6 certification",s2: "Tunnelbroker",s3: "DNS", arr:['ipv6.he.net', 'tunnelbroker.net', 'dns.he.net'],fn: function() {document.write('This is a function()');}}freesvs.s1;

Related questions

–5 votes
1 answer
posted 12 years ago in PHP by Bunny Thuta (1,200 points)
+4 votes
1 answer
+9 votes
1 answer
posted 12 years ago in HTML by atimokoena (1,400 points)
+6 votes
1 answer
posted 12 years ago in Javascript by Heidi Vincent (3,970 points)
+8 votes
1 answer
posted 12 years ago in Javascript by manlink2000 (5,280 points)