SAI
SAI
Suppose we have
User:{
userId: id,
name: String,
age: number,
number: [numbers]
}
Write an API which takes userId as param and provides array numbers for those numbers which
are ending with 89
Example:
User:{
Number:[23489,23419,4599,3849,2488,23465489]
}
Response:[23489,23465489]
/numberEndingWith89
Get request : input : user_id
Numbers = filteredUser.number
If (sampleNumberr == 89) {
arr.push(n)
}
Return arr
// Question - 2
Suppose we have
User:{
userId: id,
name: String,
age: number,
number: [String]
}
Write an API which takes userId as param and provides array numbers for those numbers which
are ending with 89
Example:
User:{
Number:[‘23489’,’23419’,4599,3849,2488,23465489] // these are strings
}
Response:[23489,23465489]
Numbers = filteredUser.number
Return arr