CodeZettaInterview Hub

HTML · APIs · Senior · Comparison

When would you use template and slot?

Short Interview Answer

template holds inert DOM; slots project light DOM into shadow trees.

Detailed Explanation

Useful for Web Components. Avoid shipping unused large templates.

Did you know this answer?