Thales interview question

Simple programs in java script