Java is to JavaScript as Car is to Carpet
Java/JavaScript Polyglot, 108 107 106 bytes

//\u000As-&gt;s.matches("(?i)(?!.*javascript)java.*"/*
a=&gt;/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet"


Run as Java



//\u000As-&gt;s.matches("(?i)(?!.*javascript)java.*"/*
a=&gt;/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet"


Try it online!

Note: don't trust the highlight as it's incorrect. The real Java, properly interpreted looks like below because \u000A is interpreted in the very first step of the compilation as \n, de facto ending the comment that started with the line comment (//).

//
s-&gt;s.matches("(?i)(?!.*javascript)java.*"/*
a=&gt;/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet"


Run as JavaScript



//\u000As-&gt;s.matches("(?i)(?!.*javascript)java.*"/*
a=&gt;/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet"


Credits to @CowsQuak for the JS version.



let f=

//\u000As-&gt;s.matches("(?i)(?!.*javascript)java.*"/*
a=&gt;/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet"

var a=["java","javafx","javabeans","java-stream","java-script","java-8","java.util.scanner","javascript","java-avascript","javascript-events","facebook-javascript-sdk","javajavascript","jquery","python","rx-java","java-api-for-javascript","not-java"];

for(var s of a) console.log(s.padStart(a.reduce((x,y)=&gt;x.length&gt;y.length?x:y).length) + "=&gt;" + f(s));




How many imaginary bonus points for this answer?

-1 byte thanks to @Nevay in the Java answer.