Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createAssemblyLine() {
- return {
- hasClima(myCar) {
- myCar.temp = 21;
- myCar.tempSettings = 21;
- myCar.adjustTemp = () => {
- if(myCar.temp < myCar.tempSettings) {
- myCar.temp++;
- } else if (myCar.temp > myCar.tempSettings) {
- myCar.temp--;
- }
- };
- },
- hasAudio(myCar) {
- myCar.currentTrack = null;
- myCar.nowPlaying = () => {
- if(myCar.currentTrack !== null) {
- console.log(`Now playing '${myCar.currentTrack.name}' by ${myCar.currentTrack.artist}`);
- }
- };
- },
- hasParktronic(myCar) {
- myCar.checkDistance = function(distance) {
- if (distance < 0.1) {
- console.log("Beep! Beep! Beep!");
- } else if (distance >= 0.1 && distance < 0.25) {
- console.log("Beep! Beep!");
- } else if (distance >= 0.25 && distance < 0.5) {
- console.log("Beep!");
- } else {
- console.log("");
- }
- };
- },
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment