Skip to content

Commit 1129498

Browse files
hekmekkjethrolarson
authored andcommitted
docs: consistently use Option instead of Optional
1 parent 18a8507 commit 1129498

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ times(-1)(console.log)
950950
// RangeError: Maximum call stack size exceeded
951951
```
952952
### Avoiding partial functions
953-
Partial functions are dangerous, you can sometimes get the expected result, sometimes the wrong result, and sometimes your function can't stop the calculations at all. The input of partial functions should be always checked, and it can be hard to track all edge cases through entire applications, the easiest way to deal with it it's just to convert all partial functions to the total. General advice can be the usage of `Optional` type, providing default values for edge cases and checking function conditions to make them always terminate:
953+
Partial functions are dangerous, you can sometimes get the expected result, sometimes the wrong result, and sometimes your function can't stop the calculations at all. The input of partial functions should be always checked, and it can be hard to track all edge cases through entire applications, the easiest way to deal with it it's just to convert all partial functions to the total. General advice can be the usage of `Option` type, providing default values for edge cases and checking function conditions to make them always terminate:
954954
```js
955955
// example 1: sum of the list
956956
// we can provide default value so it will always return result

0 commit comments

Comments
 (0)