Д
Size: a a a
Д
S
А
А
А
Д
Д
S
А
y
/(\d*)(?:(?:\W|[A-Z_])+)?$/i
-> last intА
/(\d*)(?:(?:\W|[A-Z_])+)?$/i
-> last intД
y
Д
Д
j
function calculateGuests (string) {
const match = string.match(/\d+/)
if (match) {
const number = Number(match[0])
if (number > 0) {
return number
}
}
return 'not a number'
}
S