Don't know why this way of creating a scene object is not working?

I saw the following code on Observable “Introduction to Three.js”:

sceneObject = {
const scene = new THREE.Scene(); // Create scene
scene.background = new THREE.Color(‘black’); // Sets scene background color
return scene;

I’ not sure why the same code is not working when testing it on CodeSandBox.

Is the way of creating an object from a code block particular to Observable’s JS notebook?

It’s not a valid JavaScript code

Try a different guide, like this official one: