Objects and Libraries
Last updated
Was this helpful?
Last updated
Was this helpful?
You understand the concepts of an object and you know how to access its properties
You know what an external library is and why we use them in our program
When we import the in our HTML file, we automatically get access to a global variable called tf
(short for Tinkerforge). This stores a reference to the Tinkerforge Device Manager (TDM) object and all its functionality. The TDM object is part of an external library that we import into our application and that gives us additional functionality for our app. This functionality comes as a set of functions to deal with Tinkerforge devices. If we didn't have the external library, we would have to implement the functionality ourselves, and therefore re-invent the wheel. In programming, we want to avoid re-inventing an existing functionality at all costs.
There are different ways to find out whether a functionality was already implemented by someone else. The simplest is to use Google and search for terms that describe what we need. Depending on the programming language we use, there are platforms that bundle external libraries so that they are easier to find.
is a code sharing platform for all types of code projects. with flexible filtering, for example to see only JavaScript projects.
is a platform specific for JavaScript libraries. npm is also the de facto standard for dependency management in JavaScript projects. See for example the native .