B2BÍøÂçÈí¼þ

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á ÉóºËÍøÕ¾ºÅ:QQ:896757558
ËÑË÷
²é¿´: 10|»Ø¸´: 0
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

AIWROKÈí¼þÓï·¨ÔËÐÐСʾÀý

[¸´ÖÆÁ´½Ó]

1030

Ö÷Ìâ

1035

Ìû×Ó

7397

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
7397
Ìø×ªµ½Ö¸¶¨Â¥²ã
Â¥Ö÷

AIWROKÈí¼þÓï·¨ÔËÐÐСʾÀý
AIWROKÈí¼þÓï·¨ÔËÐÐСʾÀý B2BÍøÂçÈí¼þ

AIWROKÈí¼þÓï·¨ÔËÐÐСʾÀý B2BÍøÂçÈí¼þ

AIWROKÈí¼þÓï·¨ÔËÐÐСʾÀý B2BÍøÂçÈí¼þ


  1. /*
  2. ±¾ÎļþչʾÁË JavaScript µÄºËÐĸÅÄîºÍ¸ß¼¶Ó÷¨£¬ÊʺϳõѧÕߺͽø½×¿ª·¢Õßѧϰ¡£
  3. 🍎½»Á÷QQȺ711841924Ⱥһ£¬Æ»¹ûÄÚ²âȺ£¬528816639
  4.   Óï·¨ÔËÐÐСʾÀý
  5. */

  6. // ÈÕÖ¾´°¿ÚÅäÖã¨ÈçÐèʹÓÃÇëÈ¡Ïû×¢ÊÍ£©
  7. logWindow.show()
  8. logWindow.clear()
  9. logWindow.setHeight(2500)
  10. logWindow.setWidth(1500)
  11. logWindow.setNoClickModel()

  12. var globalCounter = 0;

  13. function ComplexCalculator() {
  14.     var instanceCounter = 0;
  15.    
  16.     this.add = function(a, b) {
  17.         return a + b;
  18.     };
  19.    
  20.     this.subtract = function(a, b) {
  21.         return a - b;
  22.     };
  23.    
  24.     this.multiply = function(a, b) {
  25.         return a * b;
  26.     };
  27.    
  28.     this.divide = function(a, b) {
  29.         if (b === 0) {
  30.             throw new Error("Division by zero is not allowed");
  31.         }
  32.         return a / b;
  33.     };
  34.    
  35.     this.modulus = function(a, b) {
  36.         if (b === 0) {
  37.             throw new Error("Modulus by zero is not allowed");
  38.         }
  39.         return a % b;
  40.     };
  41.    
  42.     this.getCounter = function() {
  43.         instanceCounter++;
  44.         return instanceCounter;
  45.     };
  46. }

  47. var calculator = new ComplexCalculator();

  48. function processData(inputData) {
  49.     var result = {
  50.         numbers: [],
  51.         strings: [],
  52.         objects: [],
  53.         arrays: [],
  54.         mixed: []
  55.     };
  56.    
  57.     for (var i = 0; i < inputData.length; i++) {
  58.         var item = inputData[i];
  59.         
  60.         if (typeof item === "number") {
  61.             result.numbers.push(item);
  62.         } else if (typeof item === "string") {
  63.             result.strings.push(item);
  64.         } else if (Array.isArray(item)) {
  65.             result.arrays.push(item);
  66.         } else if (typeof item === "object" && item !== null) {
  67.             result.objects.push(item);
  68.         } else {
  69.             result.mixed.push(item);
  70.         }
  71.     }
  72.    
  73.     return result;
  74. }

  75. function createPerson(firstName, lastName, age, skills) {
  76.     var person = {
  77.         firstName: firstName,
  78.         lastName: lastName,
  79.         age: age,
  80.         skills: skills || [],
  81.         fullName: function() {
  82.             return this.firstName + " " + this.lastName;
  83.         },
  84.         addSkill: function(skill) {
  85.             this.skills.push(skill);
  86.             return this.skills.length;
  87.         },
  88.         hasSkill: function(skill) {
  89.             for (var i = 0; i < this.skills.length; i++) {
  90.                 if (this.skills[i] === skill) {
  91.                     return true;
  92.                 }
  93.             }
  94.             return false;
  95.         },
  96.         getSkillCount: function() {
  97.             return this.skills.length;
  98.         }
  99.     };
  100.    
  101.     return person;
  102. }

  103. function arrayOperations(arr) {
  104.     var operations = {
  105.         sum: 0,
  106.         average: 0,
  107.         max: null,
  108.         min: null,
  109.         reversed: [],
  110.         unique: []
  111.     };
  112.    
  113.     if (arr.length === 0) {
  114.         return operations;
  115.     }
  116.    
  117.     for (var i = 0; i < arr.length; i++) {
  118.         var value = arr[i];
  119.         
  120.         if (typeof value === "number") {
  121.             operations.sum += value;
  122.             
  123.             if (operations.max === null || value > operations.max) {
  124.                 operations.max = value;
  125.             }
  126.             
  127.             if (operations.min === null || value < operations.min) {
  128.                 operations.min = value;
  129.             }
  130.         }
  131.     }
  132.    
  133.     operations.average = operations.sum / arr.length;
  134.    
  135.     for (var j = arr.length - 1; j >= 0; j--) {
  136.         operations.reversed.push(arr[j]);
  137.     }
  138.    
  139.     var seen = {};
  140.     for (var k = 0; k < arr.length; k++) {
  141.         var item = arr[k];
  142.         var key = String(item);
  143.         if (!seen[key]) {
  144.             seen[key] = true;
  145.             operations.unique.push(item);
  146.         }
  147.     }
  148.    
  149.     return operations;
  150. }

  151. function stringManipulator(str) {
  152.     var result = {
  153.         original: str,
  154.         uppercase: null,
  155.         lowercase: null,
  156.         reversed: "",
  157.         words: [],
  158.         characterCount: 0,
  159.         wordCount: 0,
  160.         hasNumbers: false
  161.     };
  162.    
  163.     if (typeof str !== "string") {
  164.         return result;
  165.     }
  166.    
  167.     result.uppercase = str.toUpperCase();
  168.     result.lowercase = str.toLowerCase();
  169.     result.characterCount = str.length;
  170.    
  171.     for (var i = str.length - 1; i >= 0; i--) {
  172.         result.reversed += str[i];
  173.     }
  174.    
  175.     result.words = str.split(" ");
  176.     result.wordCount = result.words.length;
  177.    
  178.     for (var j = 0; j < str.length; j++) {
  179.         var charCode = str.charCodeAt(j);
  180.         if (charCode >= 48 && charCode <= 57) {
  181.             result.hasNumbers = true;
  182.             break;
  183.         }
  184.     }
  185.    
  186.     return result;
  187. }

  188. function typeChecker(value) {
  189.     var typeInfo = {
  190.         value: value,
  191.         type: typeof value,
  192.         isNull: false,
  193.         isUndefined: false,
  194.         isArray: false,
  195.         isObject: false,
  196.         isFunction: false,
  197.         isNumber: false,
  198.         isString: false,
  199.         isBoolean: false
  200.     };
  201.    
  202.     if (value === null) {
  203.         typeInfo.isNull = true;
  204.     } else if (value === undefined) {
  205.         typeInfo.isUndefined = true;
  206.     } else if (Array.isArray(value)) {
  207.         typeInfo.isArray = true;
  208.     } else if (typeof value === "object") {
  209.         typeInfo.isObject = true;
  210.     } else if (typeof value === "function") {
  211.         typeInfo.isFunction = true;
  212.     } else if (typeof value === "number") {
  213.         typeInfo.isNumber = true;
  214.     } else if (typeof value === "string") {
  215.         typeInfo.isString = true;
  216.     } else if (typeof value === "boolean") {
  217.         typeInfo.isBoolean = true;
  218.     }
  219.    
  220.     return typeInfo;
  221. }

  222. function demonstrateCaseSensitivity() {
  223.     var myVariable = "lowercase";
  224.     var MyVariable = "MixedCase";
  225.     var MYVARIABLE = "UPPERCASE";
  226.    
  227.     var result = {
  228.         myVariable: myVariable,
  229.         MyVariable: MyVariable,
  230.         MYVARIABLE: MYVARIABLE,
  231.         areAllDifferent: (myVariable !== MyVariable && MyVariable !== MYVARIABLE && myVariable !== MYVARIABLE)
  232.     };
  233.    
  234.     return result;
  235. }

  236. function controlFlowDemo(score) {
  237.     var grade = "";
  238.     var message = "";
  239.    
  240.     if (score >= 90) {
  241.         grade = "A";
  242.         message = "Excellent performance!";
  243.     } else if (score >= 80) {
  244.         grade = "B";
  245.         message = "Good job!";
  246.     } else if (score >= 70) {
  247.         grade = "C";
  248.         message = "You passed.";
  249.     } else if (score >= 60) {
  250.         grade = "D";
  251.         message = "You barely passed.";
  252.     } else {
  253.         grade = "F";
  254.         message = "You failed.";
  255.     }
  256.    
  257.     var dayOfWeek = "";
  258.     switch (grade) {
  259.         case "A":
  260.             dayOfWeek = "Monday";
  261.             break;
  262.         case "B":
  263.             dayOfWeek = "Tuesday";
  264.             break;
  265.         case "C":
  266.             dayOfWeek = "Wednesday";
  267.             break;
  268.         case "D":
  269.             dayOfWeek = "Thursday";
  270.             break;
  271.         case "F":
  272.             dayOfWeek = "Friday";
  273.             break;
  274.         default:
  275.             dayOfWeek = "Unknown";
  276.     }
  277.    
  278.     return {
  279.         score: score,
  280.         grade: grade,
  281.         message: message,
  282.         dayOfWeek: dayOfWeek
  283.     };
  284. }

  285. function loopExamples() {
  286.     var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  287.     var sum = 0;
  288.     var evenNumbers = [];
  289.     var oddNumbers = [];
  290.    
  291.     for (var i = 0; i < numbers.length; i++) {
  292.         sum += numbers[i];
  293.         
  294.         if (numbers[i] % 2 === 0) {
  295.             evenNumbers.push(numbers[i]);
  296.         } else {
  297.             oddNumbers.push(numbers[i]);
  298.         }
  299.     }
  300.    
  301.     var factorial = 1;
  302.     var n = 5;
  303.     var counter = 1;
  304.    
  305.     while (counter <= n) {
  306.         factorial *= counter;
  307.         counter++;
  308.     }
  309.    
  310.     var fibonacci = [0, 1];
  311.     var fibLength = 10;
  312.    
  313.     while (fibonacci.length < fibLength) {
  314.         var nextFib = fibonacci[fibonacci.length - 1] + fibonacci[fibonacci.length - 2];
  315.         fibonacci.push(nextFib);
  316.     }
  317.    
  318.     return {
  319.         numbers: numbers,
  320.         sum: sum,
  321.         evenNumbers: evenNumbers,
  322.         oddNumbers: oddNumbers,
  323.         factorial: factorial,
  324.         fibonacci: fibonacci
  325.     };
  326. }

  327. function errorHandlingDemo(a, b) {
  328.     var result = {
  329.         success: false,
  330.         value: null,
  331.         error: null
  332.     };
  333.    
  334.     try {
  335.         if (typeof a !== "number" || typeof b !== "number") {
  336.             throw new TypeError("Both arguments must be numbers");
  337.         }
  338.         
  339.         if (b === 0) {
  340.             throw new Error("Cannot divide by zero");
  341.         }
  342.         
  343.         result.value = a / b;
  344.         result.success = true;
  345.         
  346.     } catch (error) {
  347.         result.error = error.message;
  348.         result.success = false;
  349.     }
  350.    
  351.     return result;
  352. }

  353. function runAllExamples() {
  354.     print.log("=== JavaScript ×ÛºÏʾÀý ===\n");
  355.    
  356.     print.log("1. ¼ÆËãÆ÷ʾÀý:");
  357.     print.log("5 + 3 = " + calculator.add(5, 3));
  358.     print.log("10 - 4 = " + calculator.subtract(10, 4));
  359.     print.log("6 * 7 = " + calculator.multiply(6, 7));
  360.     print.log("20 / 4 = " + calculator.divide(20, 4));
  361.     print.log("µ÷ÓôÎÊý: " + calculator.getCounter() + "\n");
  362.    
  363.     print.log("2. Êý¾Ý´¦ÀíʾÀý:");
  364.     var mixedData = [42, "Hello", [1, 2, 3], {name: "John"}, true, null, "World", 3.14];
  365.     var processed = processData(mixedData);
  366.     print.log("Êý×Ö: " + processed.numbers);
  367.     print.log("×Ö·û´®: " + processed.strings);
  368.     print.log("Êý×é: " + JSON.stringify(processed.arrays));
  369.     print.log("¶ÔÏó: " + JSON.stringify(processed.objects));
  370.     print.log("ÆäËû: " + processed.mixed + "\n");
  371.    
  372.     print.log("3. ÈËÔ±¶ÔÏóʾÀý:");
  373.     var person = createPerson("ÕÅ", "Èý", 28, ["JavaScript", "Python"]);
  374.     print.log("È«Ãû: " + person.fullName());
  375.     print.log("Ìí¼Ó¼¼ÄÜǰ: " + person.skills);
  376.     person.addSkill("Java");
  377.     print.log("Ìí¼Ó¼¼Äܺó: " + person.skills);
  378.     print.log("ÊÇ·ñÓÐ JavaScript: " + person.hasSkill("JavaScript"));
  379.     print.log("¼¼ÄÜÊýÁ¿: " + person.getSkillCount() + "\n");
  380.    
  381.     print.log("4. Êý×é²Ù×÷ʾÀý:");
  382.     var numbers = [5, 2, 8, 1, 9, 3, 5, 2, 7];
  383.     var arrayOps = arrayOperations(numbers);
  384.     print.log("Ô­Êý×é: " + numbers);
  385.     print.log("×ܺÍ: " + arrayOps.sum);
  386.     print.log("ƽ¾ùÖµ: " + arrayOps.average);
  387.     print.log("×î´óÖµ: " + arrayOps.max);
  388.     print.log("×îСֵ: " + arrayOps.min);
  389.     print.log("·´×ª: " + arrayOps.reversed);
  390.     print.log("Ψһֵ: " + arrayOps.unique + "\n");
  391.    
  392.     print.log("5. ×Ö·û´®²Ù×÷ʾÀý:");
  393.     var strResult = stringManipulator("Hello World 123");
  394.     print.log("Ô­×Ö·û´®: " + strResult.original);
  395.     print.log("´óд: " + strResult.uppercase);
  396.     print.log("Сд: " + strResult.lowercase);
  397.     print.log("·´×ª: " + strResult.reversed);
  398.     print.log("µ¥´Ê: " + strResult.words);
  399.     print.log("×Ö·ûÊý: " + strResult.characterCount);
  400.     print.log("µ¥´ÊÊý: " + strResult.wordCount);
  401.     print.log("°üº¬Êý×Ö: " + strResult.hasNumbers + "\n");
  402.    
  403.     print.log("6. ÀàÐͼì²éʾÀý:");
  404.     var values = [42, "hello", true, null, undefined, [1, 2, 3], {key: "value"}, function() {}];
  405.     for (var i = 0; i < values.length; i++) {
  406.         var typeInfo = typeChecker(values[i]);
  407.         print.log("Öµ: " + JSON.stringify(values[i]) + " | ÀàÐÍ: " + typeInfo.type);
  408.     }
  409.     print.log("");
  410.    
  411.     print.log("7. ´óСдÃô¸ÐʾÀý:");
  412.     var caseDemo = demonstrateCaseSensitivity();
  413.     print.log("myVariable: " + caseDemo.myVariable);
  414.     print.log("MyVariable: " + caseDemo.MyVariable);
  415.     print.log("MYVARIABLE: " + caseDemo.MYVARIABLE);
  416.     print.log("¶¼²»Í¬Âð? " + caseDemo.areAllDifferent + "\n");
  417.    
  418.     print.log("8. ¿ØÖÆÁ÷ʾÀý:");
  419.     var controlResult = controlFlowDemo(85);
  420.     print.log("·ÖÊý: " + controlResult.score);
  421.     print.log("µÈ¼¶: " + controlResult.grade);
  422.     print.log("ÏûÏ¢: " + controlResult.message);
  423.     print.log("ÐÇÆÚ: " + controlResult.dayOfWeek + "\n");
  424.    
  425.     print.log("9. Ñ­»·Ê¾Àý:");
  426.     var loopResults = loopExamples();
  427.     print.log("Êý×Ö: " + loopResults.numbers);
  428.     print.log("×ܺÍ: " + loopResults.sum);
  429.     print.log("żÊý: " + loopResults.evenNumbers);
  430.     print.log("ÆæÊý: " + loopResults.oddNumbers);
  431.     print.log("5µÄ½×³Ë: " + loopResults.factorial);
  432.     print.log("ì³²¨ÄÇÆõÊýÁÐ: " + loopResults.fibonacci + "\n");
  433.    
  434.     print.log("10. ´íÎó´¦ÀíʾÀý:");
  435.     print.log("10 / 2:");
  436.     var errorResult1 = errorHandlingDemo(10, 2);
  437.     print.log("³É¹¦: " + errorResult1.success + ", ½á¹û: " + errorResult1.value);
  438.    
  439.     print.log("10 / 0:");
  440.     var errorResult2 = errorHandlingDemo(10, 0);
  441.     print.log("³É¹¦: " + errorResult2.success + ", ´íÎó: " + errorResult2.error);
  442.    
  443.     print.log("'abc' / 2:");
  444.     var errorResult3 = errorHandlingDemo("abc", 2);
  445.     print.log("³É¹¦: " + errorResult3.success + ", ´íÎó: " + errorResult3.error);
  446. }

  447. runAllExamples();
¸´ÖÆ´úÂë


»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

±¾°æ»ý·Ö¹æÔò

¹Ø±Õ

QQ|»ÓªÏúÈí¼þ×ÛºÏÌÖÂÛ|»ÓªÏúÈí¼þÓÐÎʱشð|»ÓªÏúÈí¼þ½Ì³Ì×¨Çø|»ÓªÏúÈí¼þPOST½Å±¾·ÖÏí|»ÓªÏúÈí¼þÆÕͨ½Å±¾·ÖÏí|»ÓªÏúÈí¼þÈí¼þ×ÊѶ|»ÓªÏúÈí¼þ¾«Æ·Èí¼þ|»ÓªÏúÈí¼þ¸üй«¸æ|ÓªÏúÈí¼þ|B2BÈí¼þ|B2BÍøÂçÈí¼þ ( ¾©ICP±¸09078825ºÅ )±¾ÍøÕ¾¿ª·¢µÄÓªÏúÈí¼þÊÇÒ»¿îеÄÍøÂçÓªÏúÈí¼þ£¬Õâ¿îÓªÏú¿ÉÒÔÈ¥ÍøÕ¾Èí¼þ£¬²©¿ÍÈí¼þ£¬B2BÈí¼þ£¬·ÖÀàÐÅÏ¢Íø·¢Ìù£¬¿ÉÒÔÇÀɳ·¢£¬¿ÉÒÔµ½°Ù¶ÈÎÄ¿âÉÏ´«WORDÎĵµ£¬¿ÉÒÔµ½Ò»Ð©ÊÇÏà²áÍøÕ¾×Ô¶¯ÉÏ´«Í¼Æ¬£¬Õâ¸ö×Ô¶¯·¢ÌûÈí¼þ×Ô´øÔÆÖ©Ö룬¼Ó¿ìÊÕ¼£¬ÓÐ6ÖÖ¶Ô½Ó´òÂë½Ó¿Ú£¬·½±ã£¬Ð§Âʸߣ¬Ëٶȿ죬¶øÇÒ¶ÔÍ϶¯µÄÑéÖ¤ÂëÈ«ÍøµÚÒ»¼Ò¶À¼ÒÖ§³Ö£¬È«²¿Ô­´´¼¼Êõ£¬¶À¼ÒÑз¢£¬Õý°æÔ­´´´ø°æÈ¨Èí¼þ¡£Ñ¡ÔñÍòÄÜÓªÏúÈí¼þ£¬¾ÍÑ¡ÔñÁËÒ»ÖÖ׬ǮµÄЧÂÊ£¬´ÓûÓб»³¬Ô½¹ý£¬Ò»Ö±ÔÚŬÁ¦Ñз¢Ð¼¼Êõ¡£·Å·ÉÃÎÏ룬½â·ÅË«ÊÖ£¬À´µã´´Ò⣬³É¾ÍÄãµÄÃÎÏ룬¾ÍÔÚÍòÄÜÓªÏúÈí¼þ¿ªÊ¼

map2

GMT+8, 2026-1-23 23:58 , Processed in 0.217260 second(s), 34 queries .

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí