How can I convert an object constructor from javascript to work in typescript?

Description of Problem: I am trying to learn typescript by converting an old todo list project I made in vanilla JS to a react + typescript framework.

In my old code, I had an object constructor Project that worked just fine.

function Project(title){
        this.title = title;
        this.tasks = {}; //will contain task objects for that project
    }

However, as I am trying to implement this same constructor in typescript, it seems like typescript doesn’t like my use of the word “this.” It underlines both “this” statements in red and hovering over it gives me the error: “‘this’ implicitly has type ‘any’ because it does not have a type annotation.”

What I have tried: I have tried adding types to it like so:

this.title: string = title; and title: string = title; Both give me the error: “‘string’ only refers to a type, but is being used as a value here.”

So I guess my main question would be, how would I write this same object constructor to work in typescript? What am I doing wrong with this? I have tried googling the problem but I don’t see anything about this issue specifically on stack overflow or the typescript docs.

It looks like you can still make classes in typescript but I have tried to avoid them since 1.) They aren’t “real” in javascript, just syntactical sugar, and 2.) I’d like to learn how to implement object constructors in typescript out of sheer intellectual curiosity, if possible.