[Question]
  [
### 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]]]
```
  
[Answer]
# [J](http://jsoftware.com/), ~~16~~ 15 bytes
```
[h"2[h"1 h=.,,[
```
This is an anonymous verb. [Try it online!](https://tio.run/nexus/j#@5@mYGulEJ2hZATEhgoZtno6OtH/C0CCRgrGCiYKKgqGCtoKmXoKRiZcqckZ@QrqAUWpxal5JeoQbgFUNLwosaAgNQUqaqCQplDwHwA "J – TIO Nexus")
Thanks to Adám for 1 byte!
## Explanation
```
[h"2[h"1 h=.,,[  Wrapper is x, present is y.
            ,    Prepend x to y
             ,   then append
              [  x.
                 This gives x y x, and the wrapper automatically spreads to form 2D slices.
         h=.     Save the above operation (not its result) to h.
    [h"1         Apply h to x and every 2D slice of the previous result.
[h"2             Apply h to x and every 1D slice of the result of that.
```
[Answer]
## JavaScript (ES6), 97 bytes
```
(a,e)=>[c=[,,...b=a[0]].fill(d=[,,...b[0]].fill(e)),...a.map(a=>[d,...a.map(a=>[e,...a,e]),d]),c]
```
Where `a` is the three-dimensional array and `e` is the wrapper. Automatically converts a two-dimensional array of strings to a three-dimensional array of characters. Alternative version for when `a` is a two-dimensional array of strings and `e` is a character and you want to return a two-dimensional array of strings:
```
(a,e)=>[c=[,,...a[0]].fill(d=e.repeat(a[0][0].length+2)),...a.map(b=>[c,...b.map(s=>e+s+e),d]),c]
```
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM), ~~31~~ ~~19~~ ~~13~~ 12 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319)
Almost a transliteration (31 bytes) of [@Zgarb's solution](https://codegolf.stackexchange.com/a/103905/43319).
An anonymous function. Left argument is wrapping, right argument is gift.
```
⊣h⍤1⊣h⍤2(h←⍪⍪⊣)
```
`⊣h⍤1` *h* applied, with the anonymous function's left argument, to the columns of
`⊣h⍤2` *h* applied, with the anonymous function's left argument, to the rows of
`h←` *h* applied to the major cells i.e. the layers of the anonymous function's arguments, where *h* is
 `⍪` the left argument prepended to the right argument
 `⍪` prepended to
 `⊣` the left argument
In other words, *h* is a function which surrounds its right argument (the gift) with its left argument (the wrapper). *h* is then applied to the gift's layers, then the rows of that, and finally the columns of that.
[TryAPL online!](http://tryapl.org/?a=f%u2190%u22A3h%u23641%u22A3h%u23642%28h%u2190%u236A%u236A%u22A3%29%20%u22C4%20A%u21902%202%204%u2374%27Yourgiftgoeshere%27%20%u22C4%20A%28%27.%27%20f%20A%29&run)
---
This Dyalog APL version 16.0 solution (19 bytes – courtesy of [@ngn](https://codegolf.stackexchange.com/users/24908/ngn)) handles any number of dimensions:
```
{⍵@(1+⍳⍴⍵)⊢⍺⍴⍨2+⍴⍵}
```
`⍵` the gift
`@(` placed at
 `1+` one plus
 `⍳` all the indices of
 `⍴⍵` the shape of the gift
`)⊢` in the array consisting of
`⍺⍴⍨` the wrapper reshaped to the shape
`2+` two added to
`⍴⍵` the shape of the gift
In other words, we create an array entirely of wrapper elements, which in every dimension is two elements larger than the gift, then we place the gift into that array (thus replacing the wrapping elements in those positions) at an offset of one from the edges, i.e. in the center.
---
My own invention (-1 thanks to [@ngn](https://codegolf.stackexchange.com/users/24908/ngn)):
```
(⌽2 3 1⍉,)⍣6
```
This applies an anonymous function-train 6 times, each time with the wrapper as left argument, and the result of the previous application as right argument (although the first time around it will be the unmodified gift):
`(` an anonymous function-train
 `⌽` reverse columns of
 `2 3 1⍉` the rows-to-layers, columns-to-rows, layers-to-columns transposition of
 `,` the wrapper followed by the gift
`)⍣6` applied six times
In other words, we add a layer of wrapper on the top of the array, then warp it so that the next side gets rotated into the top layer position, ready for another round of wrapping. This is repeated six times, with the final warping repositioning all axes to the original order.
[TryAPL online!](http://tryapl.org/?a=f%u2190%28%u233D2%203%201%u2349%2C%29%u23636%20%u22C4%20A%u21902%202%204%u2374%27Yourgiftgoeshere%27%20%u22C4%20A%28%27.%27%20f%20A%29&run)
[Answer]
# Octave, ~~23~~ 27 bytes
```
@(a,p)padarray(a,[1 1 1],p)
```
array: `a`  
padval: `p`
It can be called as :
```
(@(a,p)padarray(a,[1 1 1],p))([1 2;3 4],40)
```
try (paste!)it on [Octave Online](https://octave-online.net/)
note: previous answer assumed default padval
[Answer]
# Python, ~~106~~ ~~104~~ 126 bytes
```
def w(g,c):x=len(g[0][0])+2;k=[[c*x]*(len(g[0])+2)];return k+[[c*x,*[c+"".join(str(k)for k in j)+c for j in i],c*x]for i in g]+k
```
Called as `w(gift, wrapping character)`. Can use the string and the array notation. [Try it online!](https://repl.it/Eu4M/4)
[Answer]
# Perl 6, 86 bytes
```
->\a,\w{my @z=[[w xx a[0;0]+2]xx a[0]+2]xx a+2;@z[1..a;1..a[0];1..a[0;0]]=a[*;*;*];@z}
```
A lambda that takes the 3D array and wrapping character as arguments.
* It first creates a 3D output array of the correct size, filled with the wrapping character.
* Then it uses the array slice syntax to assign the values of the original array into the correct slots of the new array, in one fell swoop.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~34~~ ~~33~~ 31 bytes
```
vy¬gÌ²s×S©svy².ø¼}®)ˆ}¾F®})¯s.ø
```
[Try it online! (string)](https://tio.run/nexus/05ab1e#@19WeWhN@uGeQ5uKD08PPrSyGMjfpHd4x6E9tYfWaZ5uqz20z@3QulrNQ@uLgaL//0dHRytFKuko5QNxKRAXKcXqRCulA1mZQJwGxCVKsUAhiBhIVSoQF4NVZUB5RWA6NjaWSw8A) or [Try it online! (numerical)](https://tio.run/nexus/05ab1e#@19WeWhN@uGeQ5uKD08PPrSyGMjfpHd4x6E9tYfWaZ5uqz20z@3QulrNQ@uLgaL//0dHRxvqGMXqRBvrmMQCqWhTHTMgZa5jERsby2UAAA)
[Answer]
## Ruby, 89 bytes
```
->a,b{(w=[[z=b*2+a[0][0].tr('^|',b)]*(2+a[0].size)])+a.map{|x|[z]+x.map{|y|b+y+b}+[z]}+w}
```
Have I ever told you I'm only here to learn ruby? :-)
]