Answers for "js define constant by element id"

6

what is const in javascript

const age; // errror as const cannot be kept un-initialized;
const age = 20 ; 
const age = 21 , // error as once declared const variable cann't be
// re-declared in same scope or different scope.
Posted by: Guest on April-25-2020
0

js define constant by element id

const elem = document.getElementById('elementID');
Posted by: Guest on June-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language