```
var findMedianSortedArrays = function(nums1, nums2) {
let arr = nums1.concat(nums2);
let median = 0;
arr = arr.sort(function (a, b) { return a - b});
let n = arr.length;
if (n % 2 === 0) {
median = (arr[n/2] + arr[n/2-1])/2;
} else {
median = arr[Math.floor(n/2)];
}
return median;
};
```