Reputation: 7414
function f(a, b) {}
Taking a sample function f in javascript, how do I know how objects a and b should look like ?
In Java for example, the class is self-documenting the expected object:
class A {
private int c;
private String d;
private E e;
}
But how do I create the object in javascript, not knowing how it should look like, but making it valid for the function to run properly ?
The function f can be from a 3rd party lib, another module from the project ...
Upvotes: 0
Views: 2301
Reputation: 944110
JavaScript is a dynamically typed language. It does not enforce types for function parameters.
If you want to know what values a function expects to be passed to it you have two basic options:
Upvotes: 3