---
title: "Comment by Wordpress training London on \"Wtf is dependency injection? (JavaScript edition)\" | Hashnode"
description: "Unlike what others may have mentioned, Dependency Injection is a method that enables you to supply an object from your app&#39;s root, making it accessible anyw"
url: "https://hashnode.com/posts/wtf-is-dependency-injection-javascript-edition/654a7afc9bd342528787b32e/comment/65584dcfc808315676f4b4aa"
---

[Discussion](https://hashnode.com/posts/wtf-is-dependency-injection-javascript-edition/654a7afc9bd342528787b32e)

Comment [Wtf is dependency injection? (JavaScript edition)](https://hashnode.com/posts/wtf-is-dependency-injection-javascript-edition/654a7afc9bd342528787b32e)

[Wordpress training London](https://hashnode.com/@wordpresstraininginl)

[Nov 18, 2023](https://hashnode.com/posts/wtf-is-dependency-injection-javascript-edition/654a7afc9bd342528787b32e/comment/65584dcfc808315676f4b4aa)

Unlike what others may have mentioned, Dependency Injection is a method that enables you to supply an object from your app's root, making it accessible anywhere you need it in your app. Before this, we had to pass items like Props from the root down through each level of children, which could be cumbersome. With DI, you simply pass the Prop or Object to the Provider, assigning it a name. Later, if you're several levels down and need something from the Provider, you just call Inject with the designated name, and there you have it. This mechanism is incredibly useful. Vue.js has a great implementation of this, and it's common in other modern systems too.
