Lesson 16 of 55
15 mins readPython Call and Construct Signatures
In Plain English
In JavaScript, functions are objects that can carry additional properties alongside being callable or constructible with new.
Core Rules to Remember

Call Signatures: Enables typing functions with attached properties or methods.

Construct Signatures: Uses new (args) => Type to represent constructor functions and factories.
Live Interactive Example
Hit Run Code to see it liveCallable Interfaces and Constructors
Python 3.12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Output Console
Click "Run Code" to view the rendered output.
How it works: CounterFunction acts as a normal function while also exposing properties and utility methods.
Your Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Micro Exercise
Define an Executable Task Interface
Define interface TaskRunner: callable with () => string, plus a property taskName: string.
Create a runner constant satisfying TaskRunner with taskName "deploy" returning "deploying..." when called.
Print taskName and call output.
1
2
3
4
5
6
7
Sandbox Output
Click "Run & Check" to test your solution.
Finished reading and practicing?
Mark this lesson as completed to update your course progress.