DEV Community

Discussion on: If you made a subset of your favourite language, what would you keep.

Collapse
 
mateiadrielrafael profile image
Matei Adriel

So the rules are pretty unclear to me, but I'll assume you don't need to explicitly choose prinitives and operators, but not structures like if, for loops, switch, function definitions and objects.

So to be able to recreate objects we need functions (see nr 2#), arrays (for multiple returns) and decision making. For taking decisions we can use the ternary operator so my 1# will be arrays (maybe not object based, just the most dummy arrays ww can get)

You can implement promises yourself if you have higher order functions, so my 2# would be higher order arrow functions

Since we have functions, taill call optimization is essential for implementing looping over stuff, so that would be my 3#