Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8562319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:42:19+00:00 2026-06-11T16:42:19+00:00

<html> <head><title>Using the const Keyword</title> <script type=text/javascript> const NOON = 12; const FREEZING =

  • 0
<html>
   <head><title>Using the const Keyword</title>
       <script type="text/javascript">
          const NOON = 12;
          const FREEZING = 32; // Can't change
       </script>
   </head>
  <body bgcolor="silver">
    <big>
    <script type="text/javascript">
      document.write("Fahrenheit temp is " + FREEZING + ".<br />");
      FREEZING =32 + 10;
      NOON = NOON + " noon";
      document.write("Make it warmer " + FREEZING + ".<br />");
      document.write("See you at ", NOON, ".<br />");
    </script>
  </big>
 </body>
</html>

Above code is working fine with Firefox, Chrome, Safari but it is not working with opera 12.02. Since I have used keyword ‘const’ Result should be as follow

Farenheit temp is 32.
Make it warmer 32.
See you at 12.

But opera browser displays

Farenheit temp is 32.
Make it warmer 42.
See you at 12 noon.

What is wrong here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:42:20+00:00Added an answer on June 11, 2026 at 4:42 pm

    What’s wrong is that const isn’t officially supported in Opera, that’s all. It’s been a long time that developer claimed that, but it still lags behind. It’s still not part of ECMASCript.

    Try this instead:

    Object.defineProperty(window, "NOON", {
        value: 12, writable: false, configurable: false
    });
    

    This works in Opera. If you intend to support IE<9 too, you should use something a bit different (and less effective):

    Object.defineProperty(window, "NOON", {
        get: function() {return 12;}
    });
    

    You still won’t be able to change its value, but you’ll be able to redefine NOON with Object.defineProperty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using this to generate a textbox dynamically:` <html> <head> <title>Dynamic Form</title> <script type=text/javascript
I'm trying to get href value using jQuery: <html> <head> <title>Jquery Test</title> <script type=text/javascript
Take a look at this html: <head> <title>Test page</title> <script type=text/javascript> function submitForm() {
Heres my simple html source <html> <head> <title> Dec2Bin </title> <script type=text/javascript> function app()
I have this html code <html> <head> <title>JQuery Problem 2</title> <script type=text/javascript src=jquery-1.4.min.js></script> <script
I am using this HTML <html> <head> <Title>EBAY Search</title> </head> <script language=JavaScript src=ajaxlib.js></script> <body>
<head> <meta http-equiv=Content-Type content=text/html; charset=UTF-8 /> [{CONTENT:meta}] [{CONTENT:title}] [{CONTENT:head}] </head> [{CONTENT:open_body}] <p>[{LOCATION:main_1}]</p> <p>[{LOCATION:main_1}]</p> </body>
I am not using any javascript plugin, <html> <head> <title>sample dynamic select list</title> <script
I am using the following html page: <html> <head> <title>AJAX Example</title> <meta http-equiv=Content-Type content=text/html;
All, I'm using the following code: <head> <title>Wedding Page</title> <meta http-equiv=Content-Type content=text/html; charset=utf-8 />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.