Task
Given a wrapper element and a non-jagged 3D array, wrap the array top, bottom, and all-around. You must handle both character and numeric data, but the wrapper and the present will have the same data type.
Character example
For character data, you may chose to handle either 3D arrays of single characters or 2D arrays of strings:
Given the 2 layer, 2 row, 4 column character array
[[["Y","o","u","r"],
["g","i","f","t"]],
[["g","o","e","s"],
["h","e","r","e"]]]
and the character "."
, answer the 4 layer, 4 row, 6 column character array
[[[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".","Y","o","u","r","."],
[".","g","i","f","t","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".","g","o","e","s","."],
[".","h","e","r","e","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."]]]
or given the 2 row, 2 column array of 4-character strings
[["Your",
"gift"],
["goes",
"here"]]
and the character "."
, answer the 4 row, 4 column array of 6-character strings
[["......",
"......",
"......",
"......"],
["......",
".Your.",
".gift.",
"......"],
["......",
".goes.",
".here.",
"......"],
["......",
"......",
"......",
"......"]]
Numeric example
Given the 2 layer, 2 row, 2 column numeric array
[[[1,2],
[3,4]],
[[5,6],
[7,8]]]`
and the number 0
, answer the 4 layer, 4 row, 4 column numeric array
[[[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]],
[[0,0,0,0],
[0,1,2,0],
[0,3,4,0],
[0,0,0,0]],
[[0,0,0,0],
[0,5,6,0],
[0,7,8,0],
[0,0,0,0]],
[[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]]