If so, what is the syntax for such a declaration?
If you only care about supporting newer browsers (or are using a transpiler such as Babel to support older browsers) you can do the following:
export const FRUIT = "kiwi"; export const VEGETABLE = "carrot";
import * as Settings from './settings.js'
console.log("The unchangeable fruit is " + Settings.FRUIT);
This is a much cleaner approach than trying to implement a global constant, especially when you have multiple JavaScript files that you want to use the constants in.