Is there a way to check all the checkbox values at once

Hello Team,

I have a question while creating the Array of checkboxes. I have a list of 10 values but there is also an option All to select the rest of the values when we clicked the All option. Does anyone had come across this ?