showing results for - "functional not if then else"
Riccardo
03 May 2019
1//remove if then else...
2
3OBJECT  MAPPER
4const colors = { red: true, blue: true, 'default': false, }; 		//An object specifying the results
5const colorMapper = color => colors[color] || colors['default'];    // A mapping function
6const color = colorMapper(item.color);