What is difference between result and result_array in CI

if we use result()  to get results it will returns  the query result as an array of objects
$query = $this->db->query(“YOUR QUERY”);

foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->body;
}

if we use result_array()  to get result as a pure array
$query = $this->db->query(“YOUR QUERY”);

foreach ($query->result_array() as $row)
{
echo $row[‘title’];
echo $row[‘name’];
echo $row[‘body’];
}

 
Generating Query Results in CI