The TEXTJOIN Function joins text from two or more strings together with a delimiter separating each value.
The TEXTJOIN function takes three required arguments: delimiter, ignore_empty, and text1. The delimiter is the text to use between values that are concatenated together and should be enclosed in double-quotes (“”), for example, a space (” “) or a comma with a space (“, “). To use no delimiter, supply an empty string (“”). Ignore_empty is a Boolean (TRUE/FALSE) value that controls whether empty values should be ignored or added to the result. This is often set to TRUE to avoid delimiters with no content in the result from TEXTJOIN. Text1 is the first value to join together. This can be a cell reference, a range, or a hard-coded text value. Subsequent optional arguments, text2, text3, text4, etc. can be provided up to 252 values total.
This function can also be used to join values in multiple rows to a single cell. (The values belong to the same reference).
For Example, assume that the data contains item names and their inventory locations as shown in the below screenshot

And we need to join Locations that belong to the same item into one cell separated by a comma.
Then we have to apply the Text join function as in the screenshot below. See the formula bar to find the formula.

copy and insert the item column(Col B) so that we can check for the same item values in the formula(the IF condition). This is required as we are grouping the locations which belong to the same item. And apply the formula like in the screenshot.
Then delete Column B and Column C. Select all data and remove duplicates. (Data > Remove Duplicate).
See the below screenshot

The Inventory locations are joined together separated by commas.