Skip to content

Category by age

JavaScript if / else

Flowchart (ISO 5807)

YesNoStartInput ageage < 18Return «дитина»EndReturn «дорослий»EndFigure 1 — category

Source code

JavaScript
function category(age) {
    if (age < 18) {
        return "дитина";
    } else {
        return "дорослий";
    }
}

The editor opens with this code — change it and the chart redraws.

Language
JavaScript
Constructs
if / else
Topic
Branching
Formats
Word, Visio, draw.io, PDF, SVG

Related examples