How to get configurable option attribute label and value in Magento 2?

$productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);How to get configurable option attribute label and value in magento 2?

$attributeOptions = array();

foreach ($productAttributeOptions as $productAttribute) {
foreach ($productAttribute[‘values’] as $attribute) {
$attributeOptions[$productAttribute[‘label’]][$attribute[‘value_index’]] = $attribute[‘store_label’];
}
}

How to update a specific value in array by JavaScriptexpoundsofttechsolution How to get configurable option attribute label and value in magento 2?