JSFiddle - React, Tailwind, and code Playground

by Jessie Lau

JavaScript

function lastNum(str){
    var nums = str.match(/\d+/g);
    return Math.pow(nums[0],nums[1]) % 10;   
}

console.log(lastNum("std2hs4"));