标签: javascript ecmascript-6
const mediaDevices = () => { let deviceObj = []; navigator.mediaDevices.enumerateDevices() .then((devices) => { deviceObj = devices; }); return deviceObj; }
如果我调用mediaDevices方法,我试图返回设备。我该怎么办?