what does that even mean?

i broke out laughing when i read the following passage from "the mysterious island" by jules verne. i found it quite hilarious, but also rather confusing. the book is set at the time of the American Civil War.

Characters involved:
*Neb, a former slave who loved his master so much that he stayed on as a servant
*Gideon Spilett, a reporter for the New York Herald
*Pencroft, a sailor
*Herbert, a young man
Characters not making an appearance:
*Cyrus Harding, a military engineer for the Union Army
*Top, a dog

this group has been stranded on an island in the middle of nowhere in the south pacific, and has just found and begun to open a chest they found washed up on shore.

"Oh!" cried Neb, "suppose it's jam!"
"I hope not," replied the reporter.
"If only there was--" said the sailor in a low voice.
"What?" asked Neb, who overheard him.
The covering of the zinc was torn off and thrown back over the sides of the chest, and by degrees numerous articles of very varied character were produced and strewn about on the sand. At each new object Pencroft uttered fresh hurrahs, Herbert clapped his hands, and Neb danced--like a nigger. There were books which made Herbert wild with joy, and cooking utensils which Neb covered with kisses!

i thought to myself after reading that, what the heck does that even mean? that it's just like a n****r to dance at a time like that? he's dancing in a fashion common among n****rs? i'm really not sure what the point of that little addendum is. discuss amongst yourselves. or, as is more likely, amongst myself, since i'll probably be the only one to leave a comment.