Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if the last character of word is "A"

function lastWord(lastWord) {

    var hello = lastWord;
var lastCharOfHello=hello.slice(-1);

if (lastCharOfHello === "a")
{
return lastCharOfHello;
}
else {
   return "Not A sorry loser";
}
}
console.log(lastWord("Ray"));
Comment

PREVIOUS NEXT
Code Example
Javascript :: Convert form data to JavaScript object with jQuery 
Javascript :: RTC measure react native undefined 
Javascript :: get react form input using ref react 18 
Javascript :: jquery validate min and max value 
Javascript :: Return Instance Of Object 
Javascript :: Joining two arrays with lookup 
Javascript :: hacker news api react 
Javascript :: I want to filter the below json data by start date and end date, it should return the data between start date and end date, 
Javascript :: Backbone.model first parameter determines properties that each instance must have 
Javascript :: giftedchat anpm 
Javascript :: Constructor can also be written like this 
Javascript :: remove nth character from string javascript 
Javascript :: json to css converter 
Javascript :: angular auth guard @medium 
Javascript :: JavaScript substring when we choose negative and zero number 
Javascript :: numberformat chakra 
Javascript :: Get Error 
Javascript :: FirebaseError: Unknown field filter op. 
Javascript :: js two operations in ternary 
Javascript :: multi command run in one in terminal npm 
Javascript :: javascript change favicon dynamicly 
Javascript :: sort an array in descending order javascript 
Javascript :: how to multiply two array in javascript 
Javascript :: clear timers nodejs 
Javascript :: Maxscript Bitarray 
Javascript :: ohif add auth to config 
Javascript :: nodejs mysql Getting the number of affected rows 
Javascript :: how to add another model into type of model in mongodb schema 
Javascript :: angular universal prerender 
Javascript :: javascript vuelidate identical passwords only if checkbox is ticked 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =