Posts

Ramda - Quick Tips #1

Remove Falsey Values from an Array

Use without as a means to remove falsey values from your arrays. The first argument to the without method takes in an array which will represent the elements which are to be removed when found in the second argument array. You can include any values in the first argument array which you deem to be a "falsey" value.

R.without([false, null, ''], [false, null, '', 1, 2, null, 3, 4, false, 5]);

// Outputs
// [1, 2, 3, 4, 5]
Categories: #JavaScript
Tags: #ramda
CBOR - JSON Encoding

Compact Binary Format for JSON Data Transfer

When you wish to use JSON for its convenience, but also want to send the JSON using a more compact representation to save data that needs to be transfer, you will need to use an information encoder for JSON. These encoders tend to represent the JSON data in binary format for transfer and there are many out there.

Categories: #JavaScript
Tags: #NodeJs