default

Allows you to specify a fallback in case a value doesn’t exist. default will show its value if the left side is falsy or empty (string or Array). In this example, product_price is not defined, so the default value is used.
{{ product_price | default: 2.99 }}
2.99
In this example, product_price is defined, so the default value is not used.
{% assign product_price = 4.99 %}
{{ product_price | default: 2.99 }}
4.99
In this example, product_price is empty, so the default value is used.
{% assign product_price = "" %}
{{ product_price | default: 2.99 }}
2.99

Allowing false

To allow variables to return false instead of the default value, you can use the allow_false parameter.
{% assign display_price = false %}
{{ display_price | default: true, allow_false: true }}
false

json

Convert values to string via JSON.stringify(), for debug purpose.
{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json }}
["foo","bar","coo"]

parse_json

Convert a string value to a valid JSON object. If the value is not a valid JSON, the returned value will be nil.
{% assign obj = '{"foo": "bar"}' | parse_json %}
{% assign arr = '["Hi", "there"]' | parse_json %}
{% assign invalid = '{"foo" = "bar"}' | parse_json %}
{{ obj.foo }}
{{ arr[1]}}
{{ invalid }}
bar
there

Space

An additional space parameter can be specified to format the JSON.
{% assign arr = "foo bar coo" | split: " " %}
{{ arr | json: 4 }}
[
    "foo",
    "bar",
    "coo"
]

jsonify

See json.

inspect

Similar with json, but inspect allows cyclic structure. For the scope below:
const foo = {
    bar: 'BAR'
}
foo.foo = foo
const scope = { foo }
{% foo | inspect %}
{"bar":"BAR","foo":"[Circular]"}

Formatting

An additional space argument can be specified for the indent width.
{{ foo | inspect: 4 }}
{
    "bar": "BAR",
    "foo": "[Circular]"
}

to_integer

Convert values to number.
{{ "123" | to_integer | json }}
123