target json using a variable url code example

Example 1: how to reference variable in another file python

from vardata import verb_list, other_list
import random

print random.choice(verb_list)

Example 2: javascript dynamic variable name

var obj = {
  'prop1' : 'test1',
  'prop2' : 'test2'
}

var keys = Object.keys(obj);

for (let i = 0; i < keys.length; i++) {
  var key = keys[i];
  
  // Here you can use a string value as the property name
  var prop = obj[key];
}

Example 3: how to include local image files in javascript object

// images.js
const images = [
  { id: 1, src: './assets/image01.jpg', title: 'foo', description: 'bar' },
  { id: 2, src: './assets/image02.jpg', title: 'foo', description: 'bar' },
  { id: 3, src: './assets/image03.jpg', title: 'foo', description: 'bar' },
  { id: 4, src: './assets/image04.jpg', title: 'foo', description: 'bar' },
  { id: 5, src: './assets/image05.jpg', title: 'foo', description: 'bar' },
  ...etc
];

export default images;