--- title: "getComments" slug: "user-getcomments" updated: 2025-11-06T18:56:23Z published: 2025-11-06T18:56:23Z canonical: "docs.doc-know.com/user-getcomments" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.doc-know.com/llms.txt > Use this file to discover all available pages before exploring further. # getComments ### user.getComments Returns the user's comments for a page in your app's layout. ### Input Parameters | Name | Type | Required | Description | | --- | --- | --- | --- | | **[index]** | Number | No | Page index (default is the current page) | ### Returns Type: **Text** Returns the user's comments for the specified page in your app's layout. ### Examples ``` // display the user's comments for the current page in the debugger debug.log(user.getComments()); ``` ``` // display the user's comments for the 2nd page in the debugger // note: page indexes are zero-based debug.log(user.getComments(1)); ``` ### Remarks Reasons for getting the user's comments include: 1. **Text analysis** for **[ai](https://docs.doc-know.com/v1/docs/ai-intro)** suggestions 2. Using the comments as input into an **[ai](https://docs.doc-know.com/v1/docs/ai-intro)** **model** or **algorithm** 3. Much more! Page indexes are **zero-based**. This means the first page will have an index value of 0 and the third page will have an index value of 2. Zero-Based Indexing **Zero-based** indexing seems strange at first, but it's how programming languages (i.e. JavaScript) work with collections of things.