freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../javascript-algorithms-and-d.../palindrome-checker.arabic.md

4.8 KiB

id title isRequired challengeType videoUrl localeTitle
aaa48de84e1ecc7c742e1124 Palindrome Checker true 5

Description

قم بإرجاع true إذا كانت السلسلة المحددة متناظرة. خلاف ذلك ، تعود false . النص المتناظر هو كلمة أو جملة مكتوبة بنفس الطريقة إلى الأمام والخلف ، وتتجاهل علامات الترقيم والحالة والتباعد. ملحوظة
ستحتاج إلى إزالة جميع الأحرف غير الأبجدية الرقمية (علامات الترقيم والمسافات والرموز) وتحويل كل شيء إلى الحالة نفسها (الحالة السفلية أو العلوية) من أجل التحقق من التباين. سنقوم بتمرير سلاسل بأشكال مختلفة ، مثل "racecar" و "RaceCar" و "race CAR" وغيرها. سنقوم أيضًا بتمرير سلاسل مع رموز خاصة ، مثل "2A3*3a2" و "2A3 3a2" و "2_A3*3#A2" . تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.

Instructions

Tests

tests:
  - text: يجب أن يعيد <code>palindrome(&quot;eye&quot;)</code> قيمة منطقية.
    testString: 'assert(typeof palindrome("eye") === "boolean", "<code>palindrome("eye")</code> should return a boolean.");'
  - text: <code>palindrome(&quot;eye&quot;)</code> يجب أن تعود حقيقية.
    testString: 'assert(palindrome("eye") === true, "<code>palindrome("eye")</code> should return true.");'
  - text: <code>palindrome(&quot;_eye&quot;)</code> يجب أن ترجع true.
    testString: 'assert(palindrome("_eye") === true, "<code>palindrome("_eye")</code> should return true.");'
  - text: <code>palindrome(&quot;race car&quot;)</code> يجب أن تعود حقيقية.
    testString: 'assert(palindrome("race car") === true, "<code>palindrome("race car")</code> should return true.");'
  - text: <code>palindrome(&quot;not a palindrome&quot;)</code> يجب أن يقوم بإرجاع false.
    testString: 'assert(palindrome("not a palindrome") === false, "<code>palindrome("not a palindrome")</code> should return false.");'
  - text: '<code>palindrome(&quot;A man, a plan, a canal. Panama&quot;)</code> يجب أن تعود حقيقية.'
    testString: 'assert(palindrome("A man, a plan, a canal. Panama") === true, "<code>palindrome("A man, a plan, a canal. Panama")</code> should return true.");'
  - text: <code>palindrome(&quot;never odd or even&quot;)</code> يجب أن يُرجع صحيحًا.
    testString: 'assert(palindrome("never odd or even") === true, "<code>palindrome("never odd or even")</code> should return true.");'
  - text: يجب أن ترجع <code>palindrome(&quot;nope&quot;)</code> false.
    testString: 'assert(palindrome("nope") === false, "<code>palindrome("nope")</code> should return false.");'
  - text: <code>palindrome(&quot;almostomla&quot;)</code> يجب أن يقوم بإرجاع false.
    testString: 'assert(palindrome("almostomla") === false, "<code>palindrome("almostomla")</code> should return false.");'
  - text: '<code>palindrome(&quot;My age is 0, 0 si ega ym.&quot;)</code> يجب أن <code>palindrome(&quot;My age is 0, 0 si ega ym.&quot;)</code> true.'
    testString: 'assert(palindrome("My age is 0, 0 si ega ym.") === true, "<code>palindrome("My age is 0, 0 si ega ym.")</code> should return true.");'
  - text: <code>palindrome(&quot;1 eye for of 1 eye.&quot;)</code> يجب أن تعود خاطئة.
    testString: 'assert(palindrome("1 eye for of 1 eye.") === false, "<code>palindrome("1 eye for of 1 eye.")</code> should return false.");'
  - text: '<code>palindrome(&quot;0_0 (: /-\ :) 0-0&quot;)</code> يجب أن ترجع true.'
    testString: 'assert(palindrome("0_0 (: /-\ :) 0-0") === true, "<code>palindrome("0_0 (: /-\ :) 0-0")</code> should return true.");'
  - text: <code>palindrome(&quot;five|\_/|four&quot;)</code> يجب أن يقوم بإرجاع false.
    testString: 'assert(palindrome("five|\_/|four") === false, "<code>palindrome("five|\_/|four")</code> should return false.");'

Challenge Seed

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Solution

// solution required