How to generate grass on terrain?

I have a terrain I want to fill with grass using script. Is there any function to add grass to terrain? Please help me

Hey. This might help you: official unity docs on terrain and grass

In addition to that you can paint a texture below that that has grassy look to add to the detail.