Baseline Implementation

Build the first language version

This page supplies the visible layer. The ECMAScript logic should read the three project values below, apply the shared priority rules, and update the result panel with the winning rule and color.

ECMAScript HTML Shared Rosetta CSS

Input

Project values

Start with these visible values. Later you can change the values to test which priority rule wins.

Technology

JavaScript

Highest-priority decision input.

Application

Color Decision Engine

Checked only when technology does not win.

Classification

rosetta-stone

Checked only when technology and application do not win.

Decision Rules

Fixed priority

01

Technology

Match the technology first and return its color.

02

Application

If technology does not match, test the application.

03

Classification

If the first two rules do not match, test classification.

04

Fallback

Use the fallback color only when nothing else matches.

Visible Output

Decision result

Rule

Waiting for ECMAScript

Replace this text with the rule that actually wins.

Color

Not calculated

Update this value from the ECMAScript decision function.

Fast Code Session

Your ECMAScript task

01

Read the visible input values

Get the three existing values from the page rather than duplicating them inside the display logic.

02

Apply the priority rules

Technology first, then application, then classification, then fallback.

03

Write the result back to the page

Change the visible rule and color result so you can see what the ECMAScript decided.