Javascript 如何在对象内部获取值?
我是javascript新手,我有一个基本问题。到目前为止,我还不能面对这种类型的对象,我需要在{exif}内到达exif对象。这是我的图像对象Javascript 如何在对象内部获取值?,javascript,arrays,json,object,key-value,Javascript,Arrays,Json,Object,Key Value,我是javascript新手,我有一个基本问题。到目前为止,我还不能面对这种类型的对象,我需要在{exif}内到达exif对象。这是我的图像对象 console.log(image); 当您想查看图像数组的详细信息时,可以在下面看到结果 {exif: {…}, localIdentifier: "CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001", filename: "IMG_0006.HEIC", width:
console.log(image);
当您想查看图像数组的详细信息时,可以在下面看到结果
{exif: {…}, localIdentifier: "CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001", filename: "IMG_0006.HEIC", width: 4032, modificationDate: "1605251810", …}
creationDate: "1522437259"
cropRect: null
data: null
duration: null
exif:
ColorModel: "RGB"
DPIHeight: 72
DPIWidth: 72
Depth: 8
Orientation: 3
PixelHeight: 3024
PixelWidth: 4032
PrimaryImage: true
ProfileName: "Display P3"
{ExifAux}: {Regions: {…}}
{Exif}:
ApertureValue: 2.5260688216892597
BrightnessValue: 8.455294117647059
ColorSpace: 65535
ComponentsConfiguration: (4) [1, 2, 3, 0]
CustomRendered: 2
DateTimeDigitized: "2018:03:30 12:14:19"
DateTimeOriginal: "2018:03:30 12:14:19"
ExifVersion: (3) [2, 2, 1]
ExposureBiasValue: 0
ExposureMode: 0
ExposureProgram: 2
ExposureTime: 0.004784688995215311
FNumber: 2.4
Flash: 16
FlashPixVersion: (2) [1, 0]
FocalLenIn35mmFilm: 52
FocalLength: 6
ISOSpeedRatings: [16]
LensMake: "Apple"
LensModel: "iPhone X back dual camera 6mm
f/2.4"
LensSpecification: (4) [4, 6,
1.7999999523162842, 2.4000000953674316]
MeteringMode: 5
PixelXDimension: 4032
PixelYDimension: 3024
SceneCaptureType: 0
SceneType: 1
SensingMethod: 2
ShutterSpeedValue: 7.704253214638971
SubjectArea: (4) [2007, 1503, 2209, 1327]
SubsecTimeDigitized: "365"
SubsecTimeOriginal: "365"
WhiteBalance: 0
__proto__: Object
{GPS}: {ImgDirection: 62.766961651917406, LatitudeRef: "N", HPositioningError: 6.00090661831369, DestBearingRef: "M", Latitude: 37.76007833333333, …}
{MakerApple}: {1: 10, 2: null, 3: {…}, 4: 1, 5: 173, 6: 170, 7: 1, 8: Array(3), 10: 2, 12: Array(2), 13: 25, 14: 4, 16: 1, 20: 3, 23: 2048, 25: 34, 26: "q825s", 29: 0.004999999888241291, 31: 1, 32: "C55AB7A6-34BC-48FC-9F8C-9CCF675F4C62", 33: 0}
{TIFF}: {TileLength: 512, Software: "12.0", ResolutionUnit: 2, DateTime: "2018:03:30 12:14:19", XResolution: 72, …}
__proto__: Object
filename: "IMG_0006.HEIC"
height: 3024
localIdentifier: "CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001"
mime: "image/jpeg"
modificationDate: "1605251810"
path: "/Users/onurcicek/Library/Developer/CoreSimulator/Devices/64FBD299-2DE2-41C1-903F-53D761CDA4D3/data/Containers/Data/Application/D5250764-2878-4774-A1B8-FC965584097B/tmp/react-native-image-crop-picker/75D83B05-BF42-4786-89F0-AC7B1D103F42.jpg"
size: 4075105
sourceURL: "file:///Users/onurcicek/Library/Developer/CoreSimulator/Devices/64FBD299-2DE2-41C1-903F-53D761CDA4D3/data/Media/DCIM/100APPLE/IMG_0006.HEIC"
width: 4032
__proto__: Object
我想做的是达到{exif}的值
比如说
console.log(image.exif.{exif}.LensMake);
但我总是无法定义,请帮助您可以使用括号
[]
表示法。例子:
console.log(image.exif['{exif}']LensMake)代码>您发布的控制台文本转储已损坏(我们无法确定哪些属性属于哪些对象)。请发布控制台转储的屏幕截图。