# Dynamic Evaluation

If placeholder variables like `${file.meta.width}` aren't enough to implement your application logic, you can also use the full feature set of modern JavaScript to create dynamicAssembly instructions. These scripts will be executed on our infrastructure, and have access to all[Assembly Variables](/docs/topics/assembly-instructions.md#assembly-variables). This includes a file's meta data that Transloadit automatically determines, basic information about the Assembly runtime, and[fields that can be populated by you as a developer when creating the Assembly](/docs/api/assemblies-post.md#fields).

For example, you might want to resize images to adhere to the design principle of the[Golden Ratio](https://en.wikipedia.org/wiki/Golden%5Fratio):

![](/_next/static/media/copy.8f7d2926.svg?dpl=dpl_4duA7gehCzBDXmXrDeYXjKa1tZoa)

```json
{
  "robot": "/image/resize",
  "height": "${file.meta.width / (1 + Math.sqrt(5))/2}",
  "resize_strategy": "crop"
}

```

Or you could want to transform the output file name to upper case when[uploading to S3](/docs/robots/s3-store.md):

![](/_next/static/media/copy.8f7d2926.svg?dpl=dpl_4duA7gehCzBDXmXrDeYXjKa1tZoa)

```json
{
  "robot": "/s3/store",
  "path": "my-folder/${file.name.toUpperCase()}"
}

```

Everything inside `${...}` will get evaluated, and you have all JavaScript language features available, as long as your script doesn't perform any asynchronous operations. For example, you can use [Math](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global%5FObjects/Math),[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global%5FObjects/Date) or[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global%5FObjects/String)methods.

## Variable lookup

Dynamic evaluation is free of charges when it is a simple lookup, such as `${file.name}` or`${file.meta.faces[0]}`.

For more complex evaluations, such as `${Math.max(10, file.meta.width)}`, there are charges. This is because we invoke [🤖/script/run](/docs/robots/script-run.md) to interpret JavaScript, making evaluations harder on our machines, and a few milliseconds slower, but with a full programming language at your disposal, also that much more powerful.
