<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/8z2aIYZ_8" -->

---
title: This Image Is Also a Valid Javascript File | daily.dev
description: Images are usually stored as binary files, while a Javascript file is basically just text. Images have a concrete file format, encoding the data in a certain...
canonical: https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: This Image Is Also a Valid Javascript File | daily.dev
og:description: Images are usually stored as binary files, while a Javascript file is basically just text. Images have a concrete file format, encoding the data in a certain...
og:url: https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8
og:image: https://api.daily.dev/og/posts/8z2aIYZ_8.png
og:image:alt: This Image Is Also a Valid Javascript File
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# This Image Is Also a Valid Javascript File

**[DEV](https://daily.dev/sources/devto)** · 6 min read · 10 upvotes · 0 comments

## Summary

Images are usually stored as binary files, while a Javascript file is basically just text. Images have a concrete file format, encoding the data in a certain way. Javascript files have to follow a specific syntax in order to be executable. Can I create an image file that has valid Javascript syntax, so it is also executable?

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/sebastianstamm/this-image-is-also-a-valid-javascript-file-5fol>

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"This Image Is Also a Valid Javascript File","url":"https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8"},"datePublished":"2020-09-06T14:05:19.968Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Images are usually stored as binary files, while a Javascript file is basically just text. Images have a concrete file format, encoding the data in a certain...","image":"https://res.cloudinary.com/practicaldev/image/fetch/s--4FX-lrPc--/c_imagga_scale,f_auto,fl_progressive,h_500,q_66,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/j5rl3ldize506esp5tyu.gif","thumbnailUrl":"https://res.cloudinary.com/practicaldev/image/fetch/s--4FX-lrPc--/c_imagga_scale,f_auto,fl_progressive,h_500,q_66,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/j5rl3ldize506esp5tyu.gif","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/this-image-is-also-a-valid-javascript-file-8z2aiyz-8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":10},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"This Image Is Also a Valid Javascript File"}]}
```

