JSFiddle - React, Tailwind, and code Playground

HTML

Sometimes is it useful for data structures to inherit from other data structures. Here
is an example: Suppose we are parsing a language such as JavaScript or T E X in which
a pair of curly braces indicates a scope. Items defined in a scope are not visible out-
side of the scope. In a sense, an inner scope inherits from its outer scope. JavaScript
objects are very good at representing this relationship. The block function is called
when a left curly brace is encountered. The parse function will look up symbols from
scope , and augment scope when it defines new symbols:

JavaScript

var block = function () {
// Remember the current scope. Make a new scope that includes everything from
// the current one.

    var oldScope = scope;
    scope = Object.create(scope);

// Advance past the left curly brace.

    advance('{');

// Parse using the new scope.

    parse(scope);

// Advance past the right curly brace and discard the new scope, restoring
// the old one.

    advance('}');
    scope = oldScope;
};