# Debug Lambda in VSCode

To debug a lambda function, first we need to set break points. Open `index.ts` file and click the space before the number line. You will see a red dot appear.

![](https://918157982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnUvS_YxlJzd_mPvwZN%2F-Lp6Ee2xsaQ61AW2amn_%2F-Lp6EtXaiqGC21_JoKcK%2Fvscode-debug1001.png?alt=media\&token=966fe666-f7f2-45a2-8b93-b754441766ca)

Press `shift + command + P` and select `Tasks: Run Task` and then select`npm: debug - function-one` Finally press `F5` to start debugging process.

![](https://918157982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnUvS_YxlJzd_mPvwZN%2F-Lp6Cq-a3goSzY_DJDOj%2F-Lp6DKvthz6AZXTjJ9tp%2Fvscode1003.png?alt=media\&token=8d9b7fa0-9a93-45f2-826e-9690104189cc)

![](https://918157982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnUvS_YxlJzd_mPvwZN%2F-Lp6Ee2xsaQ61AW2amn_%2F-Lp6G2Bg8665Dub8XjE-%2Fvscode-debug1002.png?alt=media\&token=2bffab25-df30-47e2-8ddb-52ce724899e2)

![](https://918157982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnUvS_YxlJzd_mPvwZN%2F-Lp6Ee2xsaQ61AW2amn_%2F-Lp6GUcSi7DT0CVllhef%2Fvscode-debug1003.png?alt=media\&token=11ea770d-5262-424d-aaa8-4c2b12bc74a2)

Below you can see the variable values after `F5` is pressed (debugging started).

![](https://918157982-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnUvS_YxlJzd_mPvwZN%2F-Lp6V2BM9q-NFjY_t9hB%2F-Lp6V5UlkWvMlQ0ujtVb%2Fvscode-debug1004.png?alt=media\&token=5a743ca6-de19-4d3e-a070-29970d9551ff)
