Adaptive Framework 0.9.0

switch

The following is a list of properties for the function switch:

PropertyValue
briefAll combinations true
categoryscript
descriptionSupport for switch statement.
functionIdswitch
functionLabelswitch
parameters[ { "brief": "Predicate function", "dataType": "function", "dataTypeParameter": "(any value1: any, value2: any): boolean", "description": "The predicate is passed two parameters and must return a boolean. The first parameter passed is the evaluated value of the value1 parameter and the second is the value2 from a case clause. This predicate will often be \"eqx\" to use the exactly equal function but can also be any other function such as \"regexp_match\" or a lambda function.", "name": "predicate" }, { "brief": "First predicate parameter", "description": "The first parameter passed to the predicate.", "name": "value1", "canBeUndefined": true }, { "brief": "One or more value2 and statement list pairs", "description": "This is one or more case clauses which are pairs of a value2 parameter followed by a statement list or undefined parameter. One value2 can be undefined to indicate the default case clause.\n\nFor the first value2 that is undefined or calling the predicate returns true, the statement list followed by any statement lists of subsequent case clauses are executed until a break or return is encountered. The predicate is called with value1 and the case clause's value2.", "minArgs": 2, "name": "case_clause" } ]
puretrue
returns{}
scriptSupporttrue