You develop a webpage that allows a user to download a 3PEG image and convert it to a PNG file.
You need to implement the code to download the contents of the JPEG image with no additional
decoding.
Which JavaScript function should you use?
A.
readAsBinaryString()
B.
readAsArrayBuffer()
C.
readAsDataURL()
D.
readAsText()
Wow.
Where did this question come from? Certainly not the the 70-480 Exam-ref or the training guide… Anybody know of a link that can explain why this and not one of the others is the correct answer?
http://blog.teamtreehouse.com/reading-files-using-the-html5-filereader-api
readAsArrayBuffer()
The readAsArrayBuffer() method will read a Blob or File object and produce an ArrayBuffer. An ArrayBuffer is a fixed-length binary data buffer. They can come in handy when manipulating files (like converting a JPEG image to PNG).
So, it’s B