PHP’s print_r() for JavaScript

PHP offers print_r() and var_dump() methods that can print the values of arrays and objects recursively with values indented so it’s easy to debug code. There’s no print_r for JavaScript but OpenJS has an equivalent function for dumping variables in a structured format.