a little trick to traverse arrays and objects