Skip to main content
100%

Javascript Variables- const

✓ Published1🌍 Public
NNita
Last edited Nov 5, 2020
Created on Nov 3, 2020

This example demonstrates JavaScript's `const` keyword by attempting to reassign a constant variable, which triggers a runtime error. The page displays the text "Hello HTML" prominently with a font size of 13em, styled via CSS. The HTML structure includes a script tag where a `const` variable named `hotel` is initialized to 'Royal' and then reassigned to 'Rainbow', illustrating that constant variables cannot be changed. No external libraries are used; the example relies solely on native HTML, CSS, and JavaScript to showcase this fundamental language behavior.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes