DEV Community

append VS appendChild

Abdulqudus Abubakre on April 17, 2020

This is the first post in the this vs that series. A series aimed at comparing two often confusing terms, methods, objects, definition or anything ...
Collapse
 
ronakjethwa profile image
Ronak Jethwa •

Nice one! Few more suggestions for the continuation of the series!

1. Call vs Apply
2. Prototype vs __proto__
3. Map vs Set
4. .forEach vs .map on Arrays
5. for...of vs for...in
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre •

Sure, will do that. Thanks

Collapse
 
ronakjethwa profile image
Ronak Jethwa • • Edited

happy to contribute by writing one if you need :)

Collapse
 
sheedwebdev profile image
Rashid Enahora •

Thank you sir!!! That was very clear and concise!!!

Collapse
 
thebuildguy profile image
Tulsi Prasad •

Very consice and clear explanation, thanks!

Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre •

Glad I could help

Collapse
 
frugodwill profile image
Frupreneur •

"In cases where you can use .appendChild, you can use .append but not vice versa."

well if you do need that return value, appendChild does the job while .append doesnt

Collapse
 
ryanzayne profile image
Ryan Zayne •

Would anyone ever need that return value tho?

Collapse
 
dorifor profile image
Mao • • Edited

There's a lot of instances where you need the return value, if you need to reference it for a webapp / keep it somewhere / change its properties

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt •

It would be nice if you also compare the speed / efficiency.

Collapse
 
sadiqful profile image
Aliyu Abubakar •

This is straightforward

Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre •

Thanks man

Collapse
 
mmestiyak profile image
mmestiyak •

Thanks man!

Collapse
 
kelsiepaige profile image
Kelsie Paige •

Here’s the light bulb moment I’ve been looking for. You nailed it in such a clean and concise way that I could understand as I read and didn’t have to reread x10 just to sort of get the concept. That’s gold!

Collapse
 
mohammadparsajavidi profile image
mohammadparsa-javidi •

Perfect👌

Collapse
 
alialterawi profile image
Ali-alterawi •

thank you

Collapse
 
anthoniaokafor profile image
Anthonia Okafor •

Well explained

Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre •

Thanks Anthonia

Collapse
 
damilolaaaron profile image
dAMi •

This is helpful, thanks boss!

Collapse
 
mmimonir profile image
Md. Monirul Islam •

Thanks man!

Collapse
 
ben profile image
Ben Halpern •

Very clear guide

Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre •

Thanks a lot Ben :)

Collapse
 
abdohassan profile image
Abdelrahman Hassan •

Excellent explanation

Collapse
 
navin_moorthy profile image
Navin •

Very well explained !!

Collapse
 
molenamo profile image
MLM •

I UNDERSTAND, FINALLY! New to JavaScript and DOM Manipulation, this was perfect, clear, concise! Thank you!

Collapse
 
jayaali profile image
jamaicayancy •

This was perfect. Thanks!