title: How can I implement code into an Alexa Skill?
body: <p>I'm running into significant problems understanding how to turn my Python or JS code into a skill for Alexa. I have code written in Python and half written in JS, but no matter what I try, I can't seem to implement it into an Alexa skill.</p>
  <p>I've looked through so many tutorials, examples, and walkthroughs now that I'm starting to think that Alexa can't run a short code to determine her response. It seems like every single tutorial is for a facts skill which pulls from an API, which is not what I'm looking to do. At least, I don't think so - I'm still learning.</p>
  <p>I've written the code itself in VSCode, but I've been putting as much of the skill together in Amazon Developer Panel as possible, but I'm to a point where I need to calculate how many days have passed since the start date, get the modelo, and output the chores on the revolving four-day list. So far as I can tell, that isn't something I can do without writing a function or two, but everything seems to be a class in JSON. Is that all Alexa uses?</p>
  <p>I feel like I've somehow missed something really important in my education so far, or perhaps I'm completely misunderstanding Alexa skills, but I desperately need help to make sense of this.</p>
  <p>For Example, if I have this portion of the JSON code:</p>
  <pre><code>    const ChoresIntentHandler = {
  canHandle(handlerInput) {
      return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
          &amp;&amp; Alexa.getIntentName(handlerInput.requestEnvelope) === 'ChoresIntent';
  },
  handle(handlerInput) {
      const speakOutput = 'Oh, you know. Stuff.';
  
      return handlerInput.responseBuilder
          .speak(speakOutput)
          //.reprompt('add a reprompt if you want to keep the session open for the user to respond')
          .getResponse();
  }
      };
  </code></pre>
  <p>Say I want to implement this code:</p>
  <pre><code>    var one_day = 1000 * 60 * 60 * 24
  
      const measure_from = new Date('2022-04-08');
      const today = new Date();
      const diff_in_days = Math.floor((today - measure_from) / one_day) - 1 ;
  </code></pre>
  <p>Where on earth do I put it?</p>
  <p>Thank you in advance. I've been trying to figure this out for over a month and I'm out of ideas.</p>