mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-13 14:00:52 -04:00
Merge a3f1fb7956
into f207757ef0
This commit is contained in:
commit
a9d5a186d3
1 changed files with 1 additions and 4 deletions
|
@ -97,10 +97,7 @@ class Scratch3OperatorsBlocks {
|
|||
letterOf (args) {
|
||||
const index = Cast.toNumber(args.LETTER) - 1;
|
||||
const str = Cast.toString(args.STRING);
|
||||
// Out of bounds?
|
||||
if (index < 0 || index >= str.length) {
|
||||
return '';
|
||||
}
|
||||
// `charAt` handles out of bounds by returning an empty string.
|
||||
return str.charAt(index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue