How to understand the following bash script : a.sh:

    #! /bin/sh
    arg=("${@/a/b}")
    arg=("${arg[@]/c/d}")
    echo $arg
    echo ${arg[@]}
As I run the above a.sh script with different argument, the result is shown in the following:
$ ./a.sh a
b
b
$ ./a.sh  a w
b
b w
From the result, the script replace the 'a' in argument with 'b'. It is confusing for me the function of slash '/' here. And I can not understand the expression of arg[@].
